Make sure is not nil

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
This commit is contained in:
Yanqiang Miao 2018-01-05 17:07:51 +08:00
parent 411881803f
commit 19fb0da059

View File

@ -143,6 +143,9 @@ func enableCPUManagerInKubelet(f *framework.Framework) (oldCfg *kubeletconfig.Ku
oldCfg, err := getCurrentKubeletConfig()
framework.ExpectNoError(err)
newCfg := oldCfg.DeepCopy()
if newCfg.FeatureGates == nil {
newCfg.FeatureGates = make(map[string]bool)
}
// Enable CPU Manager using feature gate.
newCfg.FeatureGates[string(features.CPUManager)] = true