mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-08-08 23:37:11 +00:00
Fix panic in PodResources API test when FeatureGates is nil
The test was panicking when trying to assign to a nil map in initialConfig.FeatureGates["KubeletPodResourcesListUseActivePods"] = false. Added nil check and map initialization to match the pattern used elsewhere in the same file. Fixes panic: internal/runtime/maps/runtime_faststr_swiss.go:265 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1624,6 +1624,9 @@ var _ = SIGDescribe("POD Resources API", framework.WithSerial(), feature.PodReso
|
||||
cpus := reservedSystemCPUs.String()
|
||||
framework.Logf("configurePodResourcesInKubelet: using reservedSystemCPUs=%q", cpus)
|
||||
initialConfig.ReservedSystemCPUs = cpus
|
||||
if initialConfig.FeatureGates == nil {
|
||||
initialConfig.FeatureGates = make(map[string]bool)
|
||||
}
|
||||
initialConfig.FeatureGates["KubeletPodResourcesListUseActivePods"] = false
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user