Skip to content
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

returns error if --watch-container is not found. #750

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,21 @@ func (d *App) Run(ctx context.Context, opt RunOption) error {
return err
}
d.Log("Task definition ARN: %s", tdArn)
if opt.DryRun {
d.Log("DRY RUN OK")
return nil
}

td, err := d.DescribeTaskDefinition(ctx, tdArn)
if err != nil {
return err
}
watchContainer := containerOf(td, &opt.WatchContainer)
d.Log("Watch container: %s", *watchContainer.Name)
if watchContainer == nil {
return fmt.Errorf("container %s not found in the task definition", opt.WatchContainer)
}
d.Log("Watch container: %s", aws.ToString(watchContainer.Name))

if opt.DryRun {
d.Log("DRY RUN OK")
return nil
}

task, err := d.RunTask(ctx, tdArn, &ov, &opt)
if err != nil {
Expand Down
Loading