diff --git a/nix/vm-tests/k8s-services.nix b/nix/vm-tests/k8s-services.nix index 0ef804a65..8d57816a3 100644 --- a/nix/vm-tests/k8s-services.nix +++ b/nix/vm-tests/k8s-services.nix @@ -245,11 +245,22 @@ let def do_GET(self): path = self.path.split("?")[0] + # Grafana's datasource proxy sends a header whose value the test + # checks by digest. The record has no `forge_token_ok`, which the + # poller's subtest reads as the mark of a forge request. + if path == "/legacy-probe": + header = self.headers.get("X-Legacy") + record({ + "host": self.headers.get("Host"), + "path": path, + "legacy_header_sha256": hashlib.sha256(header.encode()).hexdigest() if header else None, + }) + self.send_error(404) + return record({ "host": self.headers.get("Host"), "path": path, "forge_token_ok": self.headers.get("Authorization") == "token ${forgeToken}", - "legacy_header_sha256": hashlib.sha256(self.headers["X-Legacy"].encode()).hexdigest() if self.headers.get("X-Legacy") else None, }) if path.endswith("/repos/search"): self.reply({"ok": True, "data": [{"full_name": "o/r", "has_actions": True, "archived": False, "mirror": False}]})