Skip to content

Commit

Permalink
FIX: waiting for pod runnning, watch event.Object bug
Browse files Browse the repository at this point in the history
  • Loading branch information
calmkart committed Apr 21, 2020
1 parent 0ad397a commit 894704e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/fwdport/fwdport.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ func (pfo *PortForwardOpts) WaitForPodRunning(signalsChan chan struct{}) (*v1.Po
// watcher until the pod status is running
for {
event, ok := <-watcher.ResultChan()
if !ok {
if !ok || event.Type == "ERROR" {
break
}
if event.Object != nil {
if event.Object != nil && event.Type == "MODIFIED" {
changedPod := event.Object.(*v1.Pod)
if changedPod.Status.Phase == v1.PodRunning {
return changedPod, nil
Expand Down

0 comments on commit 894704e

Please sign in to comment.