feat(cli): add --cluster flag to task run#2164
Conversation
huanjani
left a comment
There was a problem hiding this comment.
Looks good! Great tests!
| wkldTypeFlagDescription = fmt.Sprintf(`Type of job or svc to create. Must be one of: | ||
| %s`, strings.Join(template.QuoteSliceFunc(manifest.WorkloadTypes), ", ")) | ||
|
|
||
| clusterFlagDescription = fmt.Sprintf(`Optional. The ARN of the cluster to run the task in. |
There was a problem hiding this comment.
Can we update this to say that they could also pass the short name for the cluster so that it works similar to run-task?
There was a problem hiding this comment.
I wonder if there is an opportunity for us to simplify the --default and --cluster behavior 🤔
@huanjani discovered that we can hide flags with cobra:
copilot-cli/internal/pkg/cli/pipeline_init.go
Line 685 in 7ccb310
I wonder if we should now hide --default and if --cluster is specified with no --subnets we can default to the using default VPC subnets?
There was a problem hiding this comment.
(After an extensive search into my memory) I recalled that the --default flag was introduced in order to skip prompting for app and env. It is completely an UX thing and does nothing to the ConfigRunner.
There was a problem hiding this comment.
Will this fail to run if the cluster doesn't exist in the default vpc? I want to make sure we're defaulting to the correct thing. Can we check under the hood whether the cluster has copilot tags, then use the correct subnets automagically?
|
Code looks great btw! just the suggestions above |
…, now that --cluster flag is available
Allow user to specify the cluster to run the task in. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Allow user to specify the cluster to run the task in. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Allow user to specify the cluster to run the task in. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Allow user to specify the cluster to run the task in.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.