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

Fix stop/restart args stacking #696

Merged
merged 1 commit into from
Mar 9, 2024
Merged

Fix stop/restart args stacking #696

merged 1 commit into from
Mar 9, 2024

Conversation

dkull
Copy link

@dkull dkull commented May 18, 2023

For reboots, arguments like '-t X' are stacked as many times as there are services, because the args list is created before the for loop iterating over the containers, and the '-t X' is extended into the arguments list.

So if my Composefile.yml has services: alpha, bravo, charlie
and I do podman-compose -f Composefile.yml restart -t 1
it would output roughly:

podman restart -t 1 alpha
podman restart -t 1 -t 1 bravo
podman restart -t 1 -t 1 -t 1 charlie

The fix moves the creation of the list, that collects the args, into the loop itself. This enables it to extend the list for each loop iteration.

@dkull dkull force-pushed the devel branch 2 times, most recently from ddc95fb to 8aeada1 Compare May 18, 2023 16:14
Copy link
Contributor

@maurerle maurerle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to see this merged.

Copy link
Collaborator

@p12tic p12tic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Signed-off-by: Tanel Liiv <[email protected]>
Signed-off-by: Tanel Liiv <[email protected]>
@p12tic
Copy link
Collaborator

p12tic commented Mar 9, 2024

Only my gravatar is visible on the commit after rebase, but this is because there's no author gravatar. I didn't change authorship.

@p12tic
Copy link
Collaborator

p12tic commented Mar 9, 2024

Normally I would ask for tests, but this is so simple change which is immediately useful to users while the change is in an area that is relatively hard to unit-test. So in this particular case I merge the PR as is.

@p12tic p12tic merged commit e0fc9a7 into containers:main Mar 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants