mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-11 10:33:43 +00:00
cmd/containerboot: guard kubeClient against nil dereference (#14357)
A method on kc was called unconditionally, even if was not initialized, leading to a nil pointer dereference when TS_SERVE_CONFIG was set outside Kubernetes. Add a guard symmetric with other uses of the kubeClient. Fixes #14354. Signed-off-by: Bjorn Neergaard <bjorn@neersighted.com>
This commit is contained in:
parent
d54cd59390
commit
8b1d01161b
@ -331,8 +331,10 @@ authLoop:
|
|||||||
if err := client.SetServeConfig(ctx, new(ipn.ServeConfig)); err != nil {
|
if err := client.SetServeConfig(ctx, new(ipn.ServeConfig)); err != nil {
|
||||||
log.Fatalf("failed to unset serve config: %v", err)
|
log.Fatalf("failed to unset serve config: %v", err)
|
||||||
}
|
}
|
||||||
if err := kc.storeHTTPSEndpoint(ctx, ""); err != nil {
|
if hasKubeStateStore(cfg) {
|
||||||
log.Fatalf("failed to update HTTPS endpoint in tailscale state: %v", err)
|
if err := kc.storeHTTPSEndpoint(ctx, ""); err != nil {
|
||||||
|
log.Fatalf("failed to update HTTPS endpoint in tailscale state: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user