mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-08 14:29:45 +00:00
Restore early return for podSpecHasContainer
This commit is contained in:
@@ -73,8 +73,9 @@ func TestVisitContainersWithPath(t *testing.T) {
|
||||
|
||||
for _, tc := range testCases {
|
||||
gotNames := []string{}
|
||||
VisitContainersWithPath(tc.haveSpec, func(c *api.Container, p *field.Path) {
|
||||
VisitContainersWithPath(tc.haveSpec, func(c *api.Container, p *field.Path) bool {
|
||||
gotNames = append(gotNames, p.String())
|
||||
return true
|
||||
})
|
||||
if !reflect.DeepEqual(gotNames, tc.wantNames) {
|
||||
t.Errorf("VisitContainersWithPath() for test case %q visited containers %q, wanted to visit %q", tc.description, gotNames, tc.wantNames)
|
||||
|
Reference in New Issue
Block a user