mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-03 00:56:23 +00:00
Restore early return for podSpecHasContainer
This commit is contained in:
@@ -3435,10 +3435,12 @@ func ValidateAppArmorPodAnnotations(annotations map[string]string, spec *core.Po
|
||||
|
||||
func podSpecHasContainer(spec *core.PodSpec, containerName string) bool {
|
||||
var hasContainer bool
|
||||
podshelper.VisitContainersWithPath(spec, func(c *core.Container, _ *field.Path) {
|
||||
podshelper.VisitContainersWithPath(spec, func(c *core.Container, _ *field.Path) bool {
|
||||
if c.Name == containerName {
|
||||
hasContainer = true
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
return hasContainer
|
||||
}
|
||||
|
Reference in New Issue
Block a user