MCPcopy Index your code
hub / github.com/devspace-sh/devspace / isWaitConditionTrue

Function isWaitConditionTrue

pkg/devspace/hook/wait.go:112–139  ·  view source on GitHub ↗
(condition *latest.HookWaitConfig, podContainer *selector.SelectedPodContainer)

Source from the content-addressed store, hash-verified

110}
111
112func isWaitConditionTrue(condition *latest.HookWaitConfig, podContainer *selector.SelectedPodContainer) bool {
113 if selector.IsPodTerminating(podContainer.Pod) {
114 return false
115 }
116
117 for _, cs := range podContainer.Pod.Status.InitContainerStatuses {
118 if cs.Name == podContainer.Container.Name {
119 if condition.Running && cs.State.Running != nil && cs.Ready {
120 return true
121 }
122 if condition.TerminatedWithCode != nil && cs.State.Terminated != nil && cs.State.Terminated.ExitCode == *condition.TerminatedWithCode {
123 return true
124 }
125 }
126 }
127 for _, cs := range podContainer.Pod.Status.ContainerStatuses {
128 if cs.Name == podContainer.Container.Name {
129 if condition.Running && cs.State.Running != nil && cs.Ready {
130 return true
131 }
132 if condition.TerminatedWithCode != nil && cs.State.Terminated != nil && cs.State.Terminated.ExitCode == *condition.TerminatedWithCode {
133 return true
134 }
135 }
136 }
137
138 return false
139}

Callers 1

executeMethod · 0.85

Calls 1

IsPodTerminatingFunction · 0.92

Tested by

no test coverage detected