Merge pull request #9640 from wangchenglong01/wangchl01

Add error check to avoid panic
pull/10201/head
Matthew Fisher 3 years ago committed by GitHub
commit 67f92d63fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -645,6 +645,9 @@ func (c *Client) WaitAndGetCompletedPodPhase(name string, timeout time.Duration)
FieldSelector: fmt.Sprintf("metadata.name=%s", name), FieldSelector: fmt.Sprintf("metadata.name=%s", name),
TimeoutSeconds: &to, TimeoutSeconds: &to,
}) })
if err != nil {
return v1.PodUnknown, err
}
for event := range watcher.ResultChan() { for event := range watcher.ResultChan() {
p, ok := event.Object.(*v1.Pod) p, ok := event.Object.(*v1.Pod)

Loading…
Cancel
Save