From eb6783d98de87b27b9b05099c5440da4f625b436 Mon Sep 17 00:00:00 2001 From: Alex Wong Date: Mon, 3 Aug 2020 16:58:06 +0800 Subject: [PATCH] fix(installer): mark status as retrying rather failed when a step failed --- cmd/tke-installer/app/installer/installer.go | 4 ++-- cmd/tke-installer/app/installer/types/types.go | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/tke-installer/app/installer/installer.go b/cmd/tke-installer/app/installer/installer.go index 1ad5862bd..00b26a877 100644 --- a/cmd/tke-installer/app/installer/installer.go +++ b/cmd/tke-installer/app/installer/installer.go @@ -942,7 +942,7 @@ 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 } @@ -950,7 +950,7 @@ func (t *TKE) do() { t.Step++ t.backup() - + t.progress.Status = types.StatusDoing return true, nil }) } diff --git a/cmd/tke-installer/app/installer/types/types.go b/cmd/tke-installer/app/installer/types/types.go index d56199937..ea44fefd3 100644 --- a/cmd/tke-installer/app/installer/types/types.go +++ b/cmd/tke-installer/app/installer/types/types.go @@ -207,10 +207,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 {