fix(agent): allow disabling Tailscale netns (#618)

This commit is contained in:
QEDeD
2026-08-25 07:04:15 +02:00
committed by GitHub
parent 9375e18b55
commit a5b6ecf28e
11 changed files with 157 additions and 7 deletions
+2
View File
@@ -202,6 +202,7 @@ const agentConfig = type({
cache_ttl: "number.integer = 180000",
executable_path: 'string = "/usr/libexec/headplane/agent"',
work_dir: 'string = "/var/lib/headplane/agent"',
tailscale_netns: "boolean = true",
pre_authkey: type("unknown").narrow(deprecatedField()).optional(),
cache_path: type("unknown").narrow(deprecatedField()).optional(),
});
@@ -212,6 +213,7 @@ const partialAgentConfig = type({
cache_ttl: "number.integer?",
executable_path: "string?",
work_dir: "string?",
tailscale_netns: "boolean?",
pre_authkey: type("unknown").narrow(deprecatedField()).optional(),
cache_path: type("unknown").narrow(deprecatedField()).optional(),
});
+2
View File
@@ -94,6 +94,7 @@ export async function createAgentManager(
const cacheTtl = agentConfig.cache_ttl ?? 180_000;
const executablePath = agentConfig.executable_path;
const workDir = agentConfig.work_dir;
const tailscaleNetNS = agentConfig.tailscale_netns;
const state: SyncState = {
syncedAt: null,
@@ -125,6 +126,7 @@ export async function createAgentManager(
HEADPLANE_AGENT_TS_SERVER: headscaleUrl,
HEADPLANE_AGENT_HOSTNAME: hostName,
HEADPLANE_AGENT_DEBUG: log.debugEnabled ? "true" : "false",
HEADPLANE_AGENT_TS_NETNS: tailscaleNetNS ? "true" : "false",
};
if (authKey) {