8 Commits

Author SHA1 Message Date
David Anderson
c89875f416 cmd/containerboot: allow disabling secret storage in k8s.
In some configurations, user explicitly do not want to store
tailscale state in k8s secrets, because doing that leads to
some annoying permission issues with sidecar containers.
With this change, TS_KUBE_SECRET="" and TS_STATE_DIR=/foo
will force storage to file when running in kubernetes.

Fixes #6704.

Signed-off-by: David Anderson <danderson@tailscale.com>
(cherry picked from commit af3127711a6df3a920204623bb24e1d74df97f1b)
2022-12-16 15:58:59 -08:00
David Anderson
1e03baee59 cmd/containerboot: gracefully degrade if missing patch permissions in k8s.
Fixes #6629.

Signed-off-by: David Anderson <danderson@tailscale.com>
(cherry picked from commit 367228ef8210b78990a56c73270472cf63cce523)
2022-12-07 17:33:11 -08:00
David Anderson
77a3efaf2c cmd/containerboot: check that k8s secret permissions are correct.
Updates #6629.

Signed-off-by: David Anderson <danderson@tailscale.com>
(cherry picked from commit e36c27bcd1237272526f1a5b28cd587b575acaa1)
2022-12-07 17:33:11 -08:00
David Anderson
ae1ca4f887 cmd/containerboot: refactor tests to have more explicit phases.
In preparation for making startup more complex with IPN bus watches.

Signed-off-by: David Anderson <danderson@tailscale.com>
(cherry picked from commit e79a1eb24a0d829dc280df1bc9e97be84a8d6043)
2022-12-07 17:33:11 -08:00
David Anderson
97e3919a83 cmd/containerboot: fix some lint.
Signed-off-by: David Anderson <danderson@tailscale.com>
(cherry picked from commit a469ec8ff6dda61c7564be4b49cef1e62c28c5ac)
2022-12-07 17:33:11 -08:00
Anton Tolchanov
682abd94ba 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 <anton@tailscale.com>
(cherry picked from commit 5ff946a9e694c546427388205dd1fab92422f10f)
2022-12-07 17:33:11 -08:00
David Anderson
65f3dab4c6 cmd/containerboot: make a tests table, add more tests.
Also fix a bugs found while adding the tests, oops.

Signed-off-by: David Anderson <danderson@tailscale.com>
2022-11-10 09:14:27 -08:00
David Anderson
2111357568 cmd/containerboot: add tests.
Signed-off-by: David Anderson <danderson@tailscale.com>
2022-11-09 19:15:55 -08:00