mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Fix kube-proxy panic when running with "--cleanup-iptables=true"
This commit is contained in:
parent
165c94aa7b
commit
f12dc94fa9
@ -447,7 +447,7 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx
|
|||||||
|
|
||||||
// We omit creation of pretty much everything if we run in cleanup mode
|
// We omit creation of pretty much everything if we run in cleanup mode
|
||||||
if cleanupAndExit {
|
if cleanupAndExit {
|
||||||
return &ProxyServer{IptInterface: iptInterface}, nil
|
return &ProxyServer{IptInterface: iptInterface, CleanupAndExit: cleanupAndExit}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
client, eventClient, err := createClients(config.ClientConnection, master)
|
client, eventClient, err := createClients(config.ClientConnection, master)
|
||||||
@ -627,7 +627,9 @@ func (s *ProxyServer) Run() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Broadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: s.EventClient.Events("")})
|
if s.Broadcaster != nil && s.EventClient != nil {
|
||||||
|
s.Broadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: s.EventClient.Events("")})
|
||||||
|
}
|
||||||
|
|
||||||
// Start up a healthz server if requested
|
// Start up a healthz server if requested
|
||||||
if s.HealthzServer != nil {
|
if s.HealthzServer != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user