-
Notifications
You must be signed in to change notification settings - Fork 485
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
Provide support for conditional dependencies #1082
Conversation
@p12tic I hope you'll find this PR more according to the project standards :-) |
Thanks, way easier to review. |
There's a formatting check failing, but I think you've done enough bending to the project requirements, I will finish the rest :-) |
podman_compose.py
Outdated
if not start_point: | ||
start_point = service_name | ||
|
||
start_point = start_point or service_name |
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 think previous style was more obvious to understand.
podman_compose.py
Outdated
@@ -2546,7 +2648,8 @@ async def compose_up(compose: PodmanCompose, args): | |||
podman_args = await container_to_args(compose, cnt, detached=args.detach) | |||
subproc = await compose.podman.run([], podman_command, podman_args) | |||
if podman_command == "run" and subproc is not None: | |||
await compose.podman.run([], "start", [cnt["name"]]) | |||
# run the container |
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.
The next line says the same in the function name, no need for the comment.
Signed-off-by: Felix Rubio <felix@kngnt.org> Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Felix Rubio <felix@kngnt.org> Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Felix Rubio <felix@kngnt.org> Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Felix Rubio <felix@kngnt.org>
Signed-off-by: Felix Rubio <felix@kngnt.org>
There were a couple of pylint errors, which was more time consuming to fix. Now it's all good, thanks for your contribution. By the way, I also split the commits more, partly so that I could review them better, partly for mentioned bisecting benefits. The only more complicated commits now are 3ba0396 and a67fa0b. You can see how easier it's to review them when they contain only minimal changes needed. The rest of commits can be reviewed with much less focus. |
Currently all services dependencies are treated unconditionally. However, docker-compose supports specifying three possible conditions (started, healthy, successfully finished). This PR provides such support, also for all podman conditions, extending the existing unit tests for dependencies.
Additionally: statements to retrieve values with defaults from dictionaries have been cleaned up.
Fixes #866