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:
Kevin Hannon
2025-08-22 10:37:47 -04:00
parent 091f87c10b
commit 4a597f50b4

View File

@@ -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
})