Merge pull request #57890 from miaoyq/fix-e2e-node-panic

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix e2e-node test panic

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>



**What this PR does / why we need it**:
Execute e2e-node test locally like:
```bash
# make test-e2e-node FOCUS="should assign CPUs as expected based on the Pod spec" SKIP=""
```
received a panic see #57889
This pr fixes the panic.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #57889

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```
This commit is contained in:
Kubernetes Submit Queue 2018-01-06 16:42:28 -08:00 committed by GitHub
commit cfc1d47397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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