From c025cfcd9c98746b7f6f3dd86ef16490381ac9d5 Mon Sep 17 00:00:00 2001 From: Arvinderpal Wander Date: Thu, 21 Nov 2019 20:46:25 -0800 Subject: [PATCH] Initialize FeatureGate map for KubeProxy config. #1929 --- cmd/kubeadm/app/componentconfigs/defaults.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/kubeadm/app/componentconfigs/defaults.go b/cmd/kubeadm/app/componentconfigs/defaults.go index 528e0a1c976..4e289ef676b 100644 --- a/cmd/kubeadm/app/componentconfigs/defaults.go +++ b/cmd/kubeadm/app/componentconfigs/defaults.go @@ -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