-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
single-region cluster crud operations #7
Conversation
d1cdbda
to
4c242d6
Compare
cmd/util.go
Outdated
@@ -38,6 +40,23 @@ func getApiClient(ctx context.Context) (*ybmclient.APIClient, error) { | |||
return apiClient, nil | |||
} | |||
|
|||
func getClusterID(ctx context.Context, apiClient *ybmclient.APIClient, accountId string, projectId string, clusterName string) (clusterId string, clusterIdOk bool, errorMessage string) { | |||
clusterResp, resp, err := apiClient.ClusterApi.ListClusters(ctx, accountId, projectId).Execute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. you could change to apiClient.ClusterApi.ListClusters(ctx, accountId, projectId).Name(clusterName).Execute()
to skip the for loop
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) | ||
return | ||
} | ||
populateFlags(cmd, originalSpec, trackName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems weird to repopulate the flags with the data from the get request. I think it would be better to write some extra logic to validate that the get response has valid data (if not overwritten by the user).
Is there any other benefit of populating the flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there is. This will allow us to re-use the createClusterSpec code.
Former-commit-id: 8db0cea55583ab4249e86dcbdeaf05f1d8d9589e
No description provided.