Unverified Commit cfc1d473 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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: 's avatarYanqiang 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 ```
parents bd4d511a 19fb0da0
...@@ -143,6 +143,9 @@ func enableCPUManagerInKubelet(f *framework.Framework) (oldCfg *kubeletconfig.Ku ...@@ -143,6 +143,9 @@ func enableCPUManagerInKubelet(f *framework.Framework) (oldCfg *kubeletconfig.Ku
oldCfg, err := getCurrentKubeletConfig() oldCfg, err := getCurrentKubeletConfig()
framework.ExpectNoError(err) framework.ExpectNoError(err)
newCfg := oldCfg.DeepCopy() newCfg := oldCfg.DeepCopy()
if newCfg.FeatureGates == nil {
newCfg.FeatureGates = make(map[string]bool)
}
// Enable CPU Manager using feature gate. // Enable CPU Manager using feature gate.
newCfg.FeatureGates[string(features.CPUManager)] = true newCfg.FeatureGates[string(features.CPUManager)] = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment