-
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 <[email protected]>
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
![image](https://private-user-images.githubusercontent.com/132757/319093340-659bbc7e-2190-4d31-a1ee-9d68a34a39bb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwOTIwODQsIm5iZiI6MTcyNjA5MTc4NCwicGF0aCI6Ii8xMzI3NTcvMzE5MDkzMzQwLTY1OWJiYzdlLTIxOTAtNGQzMS1hMWVlLTlkNjhhMzRhMzliYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMVQyMTU2MjRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iM2NiMWQxYjJiNWY3NGY4YmRlOWNhMTY3YjIzYTQ0MTAxNzljMDZlMzUwY2Q0NDlkM2NmNTg4ZTM0NzIwMTYzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.N6hS6lxUi0N7iHLOJ_2rTbv1WhDX7NmCtTuev1oYtkI)