Skip to content

Commit

Permalink
fix(cluster): add unknown status for unable to fetch instance clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
JacieChao committed Aug 23, 2023
1 parent 6c4914f commit d1bef58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cluster/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,11 @@ func ListClusters(providerName string) ([]*types.ClusterInfo, error) {
}
isExist, _, err := provider.IsClusterExist()
if err != nil {
info := provider.GetCluster("")
info.Status = common.StatusUnknown
info.Master = state.Master
info.Worker = state.Worker
clusterList = append(clusterList, info)
logrus.Errorf("failed to check provider %s cluster %s exist, got error: %v ", state.Provider, state.Name, err)
continue
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const (
StatusUpgrading = "Upgrading"
// StatusRemoving instance removing status.
StatusRemoving = "Removing"
// StatusUnknown instance unknown status
StatusUnknown = "Unknown"
// UsageInfoTitle usage info title.
UsageInfoTitle = "=========================== Prompt Info ==========================="
// UsageContext usage info context.
Expand Down

0 comments on commit d1bef58

Please sign in to comment.