Returning early if podResources is nil to avoid nil pointer dereferencing

Signed-off-by: ndixita <ndixita@google.com>
This commit is contained in:
ndixita
2025-07-28 19:31:08 +00:00
parent 924b324088
commit 4b698656be

View File

@@ -201,6 +201,10 @@ func getHugepagesTestPod(f *framework.Framework, podResources *v1.ResourceRequir
},
}
if podResources == nil {
return pod
}
if podResources.Requests != nil || podResources.Limits != nil {
pod.Spec.Resources = podResources
}