Skip to content

Commit

Permalink
Only display last error when failing after multiple retries (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
kke committed Sep 7, 2021
1 parent d7c7d2e commit d5275fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/cluster/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ func (h *Host) WaitKubeNodeReady(node *Host) error {
retry.MaxJitter(time.Second*2),
retry.Delay(time.Second*3),
retry.Attempts(120),
retry.LastErrorOnly(true),
)
}

Expand Down Expand Up @@ -357,6 +358,7 @@ func (h *Host) WaitHTTPStatus(url string, expected ...int) error {
retry.MaxJitter(time.Second*2),
retry.Delay(time.Second*3),
retry.Attempts(60),
retry.LastErrorOnly(true),
)
}

Expand All @@ -373,6 +375,7 @@ func (h *Host) WaitK0sServiceRunning() error {
retry.MaxJitter(time.Second*2),
retry.Delay(time.Second*3),
retry.Attempts(60),
retry.LastErrorOnly(true),
)
}

Expand All @@ -392,6 +395,7 @@ func (h *Host) WaitK0sServiceStopped() error {
retry.MaxJitter(time.Second*2),
retry.Delay(time.Second*3),
retry.Attempts(60),
retry.LastErrorOnly(true),
)
}

Expand Down
1 change: 1 addition & 0 deletions config/cluster/k0s.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (k K0s) GenerateToken(h *Host, role string, expiry time.Duration) (token st
retry.MaxJitter(time.Second*2),
retry.Delay(time.Second*3),
retry.Attempts(60),
retry.LastErrorOnly(true),
)
return
}
Expand Down
1 change: 1 addition & 0 deletions phase/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func (p *Connect) Run() error {
retry.MaxJitter(time.Second*2),
retry.Delay(time.Second*3),
retry.Attempts(retries),
retry.LastErrorOnly(true),
)

if err != nil {
Expand Down

0 comments on commit d5275fd

Please sign in to comment.