Skip to content

Commit

Permalink
fix(installer): mark status as retrying rather failed when a step fai…
Browse files Browse the repository at this point in the history
…led (#650)
  • Loading branch information
gmemcc committed Nov 16, 2020
1 parent 6c812be commit 82f3ef9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/tke-installer/app/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -966,15 +966,15 @@ func (t *TKE) do() {
start := time.Now()
err := t.steps[t.Step].Func(ctx)
if err != nil {
t.progress.Status = types.StatusFailed
t.progress.Status = types.StatusRetrying
t.log.Errorf("%d.%s [Failed] [%fs] error %s", t.Step, t.steps[t.Step].Name, time.Since(start).Seconds(), err)
return false, nil
}
t.log.Infof("%d.%s [Success] [%fs]", t.Step, t.steps[t.Step].Name, time.Since(start).Seconds())

t.Step++
t.backup()

t.progress.Status = types.StatusDoing
return true, nil
})
}
Expand Down
9 changes: 5 additions & 4 deletions cmd/tke-installer/app/installer/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,11 @@ type ClusterProgress struct {
type ClusterProgressStatus string

const (
StatusUnknown = "Unknown"
StatusDoing = "Doing"
StatusSuccess = "Success"
StatusFailed = "Failed"
StatusUnknown = "Unknown"
StatusDoing = "Doing"
StatusSuccess = "Success"
StatusFailed = "Failed"
StatusRetrying = "Retrying"
)

type Handler struct {
Expand Down

0 comments on commit 82f3ef9

Please sign in to comment.