-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Introduce --abort-on-container-failure #11680
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11680 +/- ##
==========================================
- Coverage 54.57% 54.48% -0.10%
==========================================
Files 145 145
Lines 12605 12624 +19
==========================================
- Hits 6879 6878 -1
- Misses 5037 5053 +16
- Partials 689 693 +4 ☔ View full report in Codecov by Sentry. |
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.
Some questions about the command flags compatibility before approving
@@ -131,6 +143,7 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service, ex | |||
flags.BoolVar(&create.noRecreate, "no-recreate", false, "If containers already exist, don't recreate them. Incompatible with --force-recreate.") | |||
flags.BoolVar(&up.noStart, "no-start", false, "Don't start the services after creating them") | |||
flags.BoolVar(&up.cascadeStop, "abort-on-container-exit", false, "Stops all containers if any container was stopped. Incompatible with -d") | |||
flags.BoolVar(&up.cascadeFail, "abort-on-container-failure", false, "Stops all containers if any container exited with failure. Incompatible with -d") |
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.
Incompatible with -d
or cascadeStop
or both?
If not compatible with -d
, I think you forgot to add the associated check in validateFlags
function
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
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.
LGTM
What I did
Introduce
--abort-on-container-failure
as a custom flavor for cascade stop, which only stops on container failure (exit != 0). This allows to run "tasks" defined by services (sorry for the conceptual mismatch) and complete successfully if all succeeded, but fail if any failed, and kill the others (aka "fail fast")Related issue
closes #10225
(not mandatory) A picture of a cute animal, if possible in relation to what you did