From 5ff946a9e694c546427388205dd1fab92422f10f Mon Sep 17 00:00:00 2001 From: Anton Tolchanov Date: Tue, 6 Dec 2022 13:31:50 +0000 Subject: [PATCH] cmd/containerboot: fix TS_STATE_DIR environment variable It's supposed to set `--statedir` rather than `--state` file. Fixes #6634. Signed-off-by: Anton Tolchanov --- cmd/containerboot/main.go | 2 +- cmd/containerboot/main_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/containerboot/main.go b/cmd/containerboot/main.go index a3962d669..f243ebd20 100644 --- a/cmd/containerboot/main.go +++ b/cmd/containerboot/main.go @@ -275,7 +275,7 @@ func tailscaledArgs(cfg *settings) []string { case cfg.InKubernetes && cfg.KubeSecret != "": args = append(args, "--state=kube:"+cfg.KubeSecret, "--statedir=/tmp") case cfg.StateDir != "": - args = append(args, "--state="+cfg.StateDir) + args = append(args, "--statedir="+cfg.StateDir) default: args = append(args, "--state=mem:", "--statedir=/tmp") } diff --git a/cmd/containerboot/main_test.go b/cmd/containerboot/main_test.go index 0dba2005c..c1a950a31 100644 --- a/cmd/containerboot/main_test.go +++ b/cmd/containerboot/main_test.go @@ -146,7 +146,7 @@ func TestContainerBoot(t *testing.T) { "TS_STATE_DIR": filepath.Join(d, "tmp"), }, WantArgs1: []string{ - "/usr/bin/tailscaled --socket=/tmp/tailscaled.sock --state=/tmp --tun=userspace-networking", + "/usr/bin/tailscaled --socket=/tmp/tailscaled.sock --statedir=/tmp --tun=userspace-networking", "/usr/bin/tailscale --socket=/tmp/tailscaled.sock up --accept-dns=false --authkey=tskey-key", }, Status1: ipnstate.Status{