Skip to content

Commit cd259f8

Browse files
committed
Merge pull request #304 from kmala/race
fix(slugbuilder): check for the succeded status while waiting for slugbuilder pod
2 parents ab88b54 + d541d7c commit cd259f8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pkg/gitreceive/k8s_util.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,15 @@ func addEnvToPod(pod api.Pod, key, value string) {
170170
}
171171
}
172172

173-
// waitForPod waits for a pod in state running or failed
173+
// waitForPod waits for a pod in state running, succeeded or failed
174174
func waitForPod(c *client.Client, ns, podName string, ticker, interval, timeout time.Duration) error {
175175
condition := func(pod *api.Pod) (bool, error) {
176176
if pod.Status.Phase == api.PodRunning {
177177
return true, nil
178178
}
179+
if pod.Status.Phase == api.PodSucceeded {
180+
return true, nil
181+
}
179182
if pod.Status.Phase == api.PodFailed {
180183
return true, fmt.Errorf("Giving up; pod went into failed status: \n%s", fmt.Sprintf("%#v", pod))
181184
}

0 commit comments

Comments
 (0)