-
Notifications
You must be signed in to change notification settings - Fork 421
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
chore: update task run
to use manager roles and update manager permissions
#1212
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 to me. Just a small nit.
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 pretty good to me! Just one tiny nit
@@ -563,16 +563,22 @@ func TestTaskRunOpts_Execute(t *testing.T) { | |||
|
|||
opts := &runTaskOpts{ | |||
runTaskVars: runTaskVars{ | |||
GlobalOpts: &GlobalOpts{}, |
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: can we remove this?
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.
no because we need it to call AppName()
in deploy()
😢
internal/pkg/cli/task_run_test.go
Outdated
if opts.env != "" { | ||
opts.deployOpts = []awscloudformation.StackOption{awscloudformation.WithRoleARN("execution role")} | ||
} |
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.
Mmm we shouldn't have custom logic in our tests otherwise we are not testing the real code-path.
I wonder if instead we should store the targetEnv
as a field and have that lookup in the deploy()
method so that we test if the real code checks if an env is not nil and passes the appropriate execution role arn.
I really like the two test-cases written above :)
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.
If targetEnv
is being set in configureRuntimeOpts
, it seems like we will still not able to set it without writing custom logic in the tests, right?
It seems to me that in order to make the testing work, I will have to somehow isolate the targetEnv
-related logic from configureRuntimeOpts
.
This is reflected in the latest code change. I'm not sure if I like this approach - please let me know what you think👀
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.
jes totally makes sense, thank you!
internal/pkg/cli/task_run.go
Outdated
func (o *runTaskOpts) configureSessAndEnv() error { | ||
var sess *awssession.Session | ||
var env *config.Environment | ||
var err error |
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: not needded
f1e629d
to
7e5ca73
Compare
This PR contains the following changes: 1. implement `--follow` flag for `task run` 2. implement `EarliestStartTime` method in `task` package in support of `--follow` 3. wrap `aws-sdk-go/ecs` constant `DesiredStatusStopped` in `ecs` package in support of `--follow` Should be merged only after #1212 Related #702 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This PR contains the following changes:
task run
task run
to use environment managerBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.