Skip to content

Commit daacdcc

Browse files
Andy Goldsteinsmarterclayton
Andy Goldstein
authored andcommitted
UPSTREAM: 31150: Check init containers in PodContainerRunning
:100644 100644 143fd4c... a83c3fe... M pkg/client/unversioned/conditions.go
1 parent 4aa9188 commit daacdcc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/client/unversioned/conditions.go

+9
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,15 @@ func PodContainerRunning(containerName string) watch.ConditionFunc {
238238
}
239239
return s.State.Running != nil, nil
240240
}
241+
for _, s := range t.Status.InitContainerStatuses {
242+
if s.Name != containerName {
243+
continue
244+
}
245+
if s.State.Terminated != nil {
246+
return false, ErrContainerTerminated
247+
}
248+
return s.State.Running != nil, nil
249+
}
241250
return false, nil
242251
}
243252
return false, nil

0 commit comments

Comments
 (0)