mirror of https://github.com/k3s-io/k3s
Merge pull request #49137 from deads2k/proxier-01-really-nil
Automatic merge from submit-queue (batch tested with PRs 49058, 49072, 49137, 49182, 49045) check for nil value in interface for proxier health golang allows for a non-nil interface to have a nil value (not type). This results in an NPE at runtime. @sttts remember that bit about go? Trivia becomes real :(pull/6/head
commit
cb1f42ad18
|
@ -463,8 +463,10 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx
|
|||
recorder := eventBroadcaster.NewRecorder(scheme, clientv1.EventSource{Component: "kube-proxy", Host: hostname})
|
||||
|
||||
var healthzServer *healthcheck.HealthzServer
|
||||
var healthzUpdater healthcheck.HealthzUpdater
|
||||
if len(config.HealthzBindAddress) > 0 {
|
||||
healthzServer = healthcheck.NewDefaultHealthzServer(config.HealthzBindAddress, 2*config.IPTables.SyncPeriod.Duration)
|
||||
healthzUpdater = healthzServer
|
||||
}
|
||||
|
||||
var proxier proxy.ProxyProvider
|
||||
|
@ -498,7 +500,7 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx
|
|||
hostname,
|
||||
nodeIP,
|
||||
recorder,
|
||||
healthzServer,
|
||||
healthzUpdater,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to create proxier: %v", err)
|
||||
|
|
Loading…
Reference in New Issue