@@ -171,7 +171,7 @@ func addEnvToPod(pod api.Pod, key, value string) {
171171}
172172
173173// waitForPod waits for a pod in state running or failed
174- func waitForPod (c * client.Client , ns , podName string , interval , timeout time.Duration ) error {
174+ 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
@@ -182,7 +182,11 @@ func waitForPod(c *client.Client, ns, podName string, interval, timeout time.Dur
182182 return false , nil
183183 }
184184
185- return waitForPodCondition (c , ns , podName , condition , interval , timeout )
185+ quit := progress ("..." , ticker )
186+ err := waitForPodCondition (c , ns , podName , condition , interval , timeout )
187+ quit <- true
188+ <- quit
189+ return err
186190}
187191
188192// waitForPodEnd waits for a pod in state succeeded or failed
@@ -222,3 +226,21 @@ func waitForPodCondition(c *client.Client, ns, podName string, condition func(po
222226 return false , nil
223227 })
224228}
229+
230+ func progress (msg string , interval time.Duration ) chan bool {
231+ tick := time .Tick (interval )
232+ quit := make (chan bool )
233+ go func () {
234+ for {
235+ select {
236+ case <- quit :
237+ close (quit )
238+ return
239+ case <- tick :
240+ fmt .Println (msg )
241+ default :
242+ }
243+ }
244+ }()
245+ return quit
246+ }
0 commit comments