Skip to content

Commit

Permalink
Merge pull request #269 from dzdx/fix-log-error
Browse files Browse the repository at this point in the history
🐛 logging error when starting control plane failed
  • Loading branch information
k8s-ci-robot committed Jan 8, 2019
2 parents 60b09a8 + e415a41 commit b3d5de2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/envtest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,16 @@ func (te *Environment) Start() (*rest.Config, error) {

func (te *Environment) startControlPlane() error {
numTries, maxRetries := 0, 5
var err error
for ; numTries < maxRetries; numTries++ {
// Start the control plane - retry if it fails
err := te.ControlPlane.Start()
err = te.ControlPlane.Start()
if err == nil {
break
}
}
if numTries == maxRetries {
return fmt.Errorf("failed to start the controlplane. retried %d times", numTries)
return fmt.Errorf("failed to start the controlplane. retried %d times: %s", numTries, err.Error())
}
return nil
}
Expand Down

0 comments on commit b3d5de2

Please sign in to comment.