@@ -281,47 +281,10 @@ func (c *Connection) WaitForContainer() error {
281281 return errors .New (L ("container didn't start within 10s." ))
282282}
283283
284- // WaitForServer waits at most 120s for multi-user systemd target to be reached.
285- func (c * Connection ) WaitForServer () error {
286- // Wait for the system to be up
287- for i := 0 ; i < 120 ; i ++ {
288- podName , err := c .GetPodName ()
289- if err != nil {
290- log .Debug ().Err (err )
291- time .Sleep (1 * time .Second )
292- continue
293- }
294-
295- namespace , err := c .GetNamespace ("" )
296- if err != nil {
297- return err
298- }
299-
300- args := []string {"exec" , podName }
301- command , err := c .GetCommand ()
302- if err != nil {
303- return err
304- }
305-
306- if command == "kubectl" {
307- args = append (args , "-n" , namespace , "--" )
308- }
309- args = append (args , "systemctl" , "is-active" , "-q" , "multi-user.target" )
310- output := utils .RunCmd (command , args ... )
311- isActive := output == nil
312-
313- if isActive {
314- return nil
315- }
316- time .Sleep (1 * time .Second )
317- }
318- return errors .New (L ("server didn't start within 120s. Check for the service status" ))
319- }
320-
321- // WaitForHealthcheck waits at most 60s for healtcheck to succeed.
284+ // WaitForHealthcheck waits at most 120s for healtcheck to succeed.
322285func (c * Connection ) WaitForHealthcheck () error {
323286 // Wait for the system to be up
324- for i := 0 ; i < 60 ; i ++ {
287+ for i := 0 ; i < 120 ; i ++ {
325288 _ , err := c .Healthcheck ()
326289 if err != nil {
327290 log .Debug ().Err (err )
@@ -330,7 +293,7 @@ func (c *Connection) WaitForHealthcheck() error {
330293 }
331294 return nil
332295 }
333- return errors .New (L ("container didn't start within 60s . Check for the service status" ))
296+ return errors .New (L ("container didn't start within 120s . Check for the service status" ))
334297}
335298
336299// Copy transfers a file to or from the container.
0 commit comments