Skip to content

Commit

Permalink
Recreate podWatcher if there is an issue accessing to pod events (#1247)
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com>
  • Loading branch information
pchico83 committed Jan 21, 2021
1 parent 0f15e72 commit c64a789
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/k8s/pods/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ func WaitUntilRunning(ctx context.Context, dev *model.Dev, podName string, c *ku
pod, ok := event.Object.(*v1.Pod)
if !ok {
log.Errorf("type error getting pod: %s", event)
watchPod, err = c.CoreV1().Pods(dev.Namespace).Watch(ctx, opts)
if err != nil {
return err
}
continue
}
log.Infof("dev pod %s is now %s", pod.Name, pod.Status.Phase)
Expand Down

0 comments on commit c64a789

Please sign in to comment.