fix: handle registration keys on headscale 0.29+

Closes HP-555.
This commit is contained in:
Aarnav Tale
2026-07-04 00:07:53 -04:00
parent 990e1e9ff5
commit 948cfad58c
11 changed files with 206 additions and 15 deletions
+1
View File
@@ -44,6 +44,7 @@ export async function getNode(version: Version) {
const { tailscaleNode } = await ensureVersion(version);
return {
authCode: tailscaleNode.authCode,
registerUrl: tailscaleNode.registerUrl,
nodeName: tailscaleNode.nodeName,
};
}
+5 -3
View File
@@ -9,6 +9,7 @@ export type Version = string;
export interface TailscaleNodeEnv {
container: tc.StartedTestContainer;
authCode: string;
registerUrl: string;
nodeName: string;
}
@@ -53,7 +54,7 @@ export async function startTailscaleNode(
if (!token) return;
authCodeResolved = true;
resolveAuthCode(token);
resolveAuthCode(`${prefix}${token}`);
rl.close();
});
@@ -68,7 +69,7 @@ export async function startTailscaleNode(
.withWaitStrategy(tc.Wait.forLogMessage(prefix).withStartupTimeout(30_000))
.start();
const authCode = await Promise.race<string>([
const registerUrl = await Promise.race<string>([
authCodePromise,
new Promise((_, reject) =>
setTimeout(
@@ -77,6 +78,7 @@ export async function startTailscaleNode(
),
),
]);
const authCode = registerUrl.slice(prefix.length);
return { container, authCode, nodeName };
return { container, authCode, registerUrl, nodeName };
}