Merge pull request #85524 from Nordix/kubeadm-kube-proxy-feature-gate-panic-fix

Initialize FeatureGate map for KubeProxy config. #1929
This commit is contained in:
Kubernetes Prow Robot 2019-11-22 08:27:29 -08:00 committed by GitHub
commit 3028dc1f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,6 +63,12 @@ func DefaultKubeProxyConfiguration(internalcfg *kubeadmapi.ClusterConfiguration)
FeatureGates: map[string]bool{},
}
}
// The below code is necessary because while KubeProxy may be defined, the user may not
// have defined any feature-gates, thus FeatureGates will be nil and the later insertion
// of any feature-gates (e.g. IPv6DualStack) will cause a panic.
if internalcfg.ComponentConfigs.KubeProxy.FeatureGates == nil {
internalcfg.ComponentConfigs.KubeProxy.FeatureGates = map[string]bool{}
}
externalproxycfg := internalcfg.ComponentConfigs.KubeProxy