cmd/containerboot: don't write device ID when not in Kubernetes.

Fixes #6218.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2022-11-07 14:58:03 -08:00 committed by Dave Anderson
parent e0669555dd
commit bf2d3cd074

View File

@ -133,7 +133,7 @@ func main() {
log.Fatalf("installing proxy rules: %v", err) log.Fatalf("installing proxy rules: %v", err)
} }
} }
if cfg.KubeSecret != "" { if cfg.InKubernetes && cfg.KubeSecret != "" {
if err := storeDeviceID(ctx, cfg.KubeSecret, string(st.Self.ID)); err != nil { if err := storeDeviceID(ctx, cfg.KubeSecret, string(st.Self.ID)); err != nil {
log.Fatalf("storing device ID in kube secret: %v", err) log.Fatalf("storing device ID in kube secret: %v", err)
} }