Kaynağa Gözat

cmd/containerboot: don't attempt to write kube Secret in non-kube environments (#14358)

Updates tailscale/tailscale#14354

Signed-off-by: Irbe Krumina <[email protected]>
Irbe Krumina 1 yıl önce
ebeveyn
işleme
0cc071f154
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      cmd/containerboot/serve.go

+ 4 - 2
cmd/containerboot/serve.go

@@ -72,8 +72,10 @@ func watchServeConfigChanges(ctx context.Context, path string, cdChanged <-chan
 		if err := updateServeConfig(ctx, sc, certDomain, lc); err != nil {
 			log.Fatalf("serve proxy: error updating serve config: %v", err)
 		}
-		if err := kc.storeHTTPSEndpoint(ctx, certDomain); err != nil {
-			log.Fatalf("serve proxy: error storing HTTPS endpoint: %v", err)
+		if kc != nil {
+			if err := kc.storeHTTPSEndpoint(ctx, certDomain); err != nil {
+				log.Fatalf("serve proxy: error storing HTTPS endpoint: %v", err)
+			}
 		}
 		prevServeConfig = sc
 	}