Skip to content

Commit

Permalink
Don't wait for task when it is not created (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
posriniv authored Jul 17, 2024
1 parent de0b1f8 commit 854337b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/cluster/update_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ var updateClusterCmd = &cobra.Command{
}
clusterData := []ybmclient.ClusterData{resp.GetData()}

msg := fmt.Sprintf("The cluster %s is being updated", formatter.Colorize(clusterName, formatter.GREEN_COLOR))
msg := fmt.Sprintf("The cluster %s is being updated and will begin updating if there are changes", formatter.Colorize(clusterName, formatter.GREEN_COLOR))

if viper.GetBool("wait") && !isNameChange {
returnStatus, err := authApi.WaitForTaskCompletion(clusterID, ybmclient.ENTITYTYPEENUM_CLUSTER, ybmclient.TASKTYPEENUM_EDIT_CLUSTER, []string{"FAILED", "SUCCEEDED"}, msg)
Expand Down
4 changes: 4 additions & 0 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,8 @@ func (a *AuthApiClient) WaitForTaskCompletionCI(entityId string, entityType ybmc
output = output + "\n" + ". Task " + strconv.Itoa(index+1) + ": " + action.GetName() + " " + strconv.Itoa(int(action.GetPercentComplete())) + "% completed"
}
}
} else {
currentStatus = "SUCCEEDED"
}
}
if slices.Contains(completionStatus, currentStatus) {
Expand Down Expand Up @@ -1410,6 +1412,8 @@ func (a *AuthApiClient) WaitForTaskCompletionFull(entityId string, entityType yb
output = output + "\n" + ". Task " + strconv.Itoa(index+1) + ": " + action.GetName() + " " + strconv.Itoa(int(action.GetPercentComplete())) + "% completed"
}
}
} else {
currentStatus = "SUCCEEDED"
}
}
s.Suffix = output
Expand Down

0 comments on commit 854337b

Please sign in to comment.