Skip to content

Commit 40fd145

Browse files
committed
looping through all container for eni requests
1 parent c6d9015 commit 40fd145

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/utils/helper.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,10 @@ func GetSourceAcctAndArn(roleARN, region, clusterName string) (string, string, e
238238
// PodHasENIRequest will return true if first container of pod spec has request for eni indicating
239239
// it needs trunk interface from vpc-rc
240240
func PodHasENIRequest(pod *v1.Pod) bool {
241-
if len(pod.Spec.Containers) > 0 {
242-
_, hasEniRequest := pod.Spec.Containers[0].Resources.Requests[config.ResourceNamePodENI]
243-
return hasEniRequest
241+
for _, container := range pod.Spec.Containers {
242+
if _, hasEniRequest := container.Resources.Requests[config.ResourceNamePodENI]; hasEniRequest {
243+
return true
244+
}
244245
}
245246
return false
246247
}

0 commit comments

Comments
 (0)