diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9c1920f..6d66816 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,10 @@ -image: python:3.11 +image: python:3.11-bookwork stages: - test - build test: + image: python:3.11-bookworm stage: test variables: TAILSCALESD_API_KEY: tskey-dummy diff --git a/tailscalesd/main.py b/tailscalesd/main.py index 3e3a864..cf30beb 100644 --- a/tailscalesd/main.py +++ b/tailscalesd/main.py @@ -140,6 +140,16 @@ def matrix_workers_to_sd(tailnet, device, workers) -> List[Dict]: async def matrix_sd(tailnet, devices) -> List[Dict]: sd: List[Dict] = [] for device in devices: + hostname = device.get("hostname", None) + if not hostname: + log.warn("device doesn't have a hostname!", extra={"device": device}) + continue + if "tags" not in device: + log.warn( + f"device does not have any tags! hostname={hostname}", + extra={"device": device}, + ) + continue if MATRIX_TAG not in device["tags"]: continue try: