cmd/containerboot: only wipeout serve config when TS_SERVE_CONFIG is set

Fixes #9558

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/9594/head
Maisem Ali 1 year ago committed by Maisem Ali
parent 246e0ccdca
commit d71184d674

@ -258,10 +258,13 @@ authLoop:
if err := tailscaleSet(ctx, cfg); err != nil { if err := tailscaleSet(ctx, cfg); err != nil {
log.Fatalf("failed to auth tailscale: %v", err) log.Fatalf("failed to auth tailscale: %v", err)
} }
// Remove any serve config that may have been set by a previous
// run of containerboot. if cfg.ServeConfigPath != "" {
if err := client.SetServeConfig(ctx, new(ipn.ServeConfig)); err != nil { // Remove any serve config that may have been set by a previous run of
log.Fatalf("failed to unset serve config: %v", err) // containerboot, but only if we're providing a new one.
if err := client.SetServeConfig(ctx, new(ipn.ServeConfig)); err != nil {
log.Fatalf("failed to unset serve config: %v", err)
}
} }
if cfg.InKubernetes && cfg.KubeSecret != "" && cfg.KubernetesCanPatch && cfg.AuthOnce { if cfg.InKubernetes && cfg.KubeSecret != "" && cfg.KubernetesCanPatch && cfg.AuthOnce {

Loading…
Cancel
Save