-
Notifications
You must be signed in to change notification settings - Fork 428
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
feat(cli): add --cluster flag to task run #2164
Conversation
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.
Looks good! Great tests!
internal/pkg/cli/flag.go
Outdated
@@ -132,6 +133,8 @@ Mutually exclusive with -%s, --%s`, imageFlagShort, imageFlag) | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
_ = cmd.Flags().MarkHidden(githubURLFlag) |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.