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

Handle --rm when starting a container #8688

Merged
merged 1 commit into from
Dec 12, 2020

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Dec 10, 2020

podman start should follow the same behaviour as podman run when removing a
container.

Fixes: #7746

Signed-off-by: Daniel J Walsh [email protected]

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 10, 2020
@rhatdan
Copy link
Member Author

rhatdan commented Dec 10, 2020

@edsantiago @mheon I am not sure this is the correct behaviour.

IE Should failing to start, remove an autoremove container?

podman run -rm fedora foo

podman create --name test1 --rm alpine foo;podman start test1

Both remove it, so for consistancy

podman-run create --name test1 --rm alpine foo;podman-run start test1

Will also.

@edsantiago
Copy link
Member

@rhatdan I think we should probably preserve the behavior documented in podman-create(1):

Note that the container will not be removed when it could not be created or started successfully. This allows the user to inspect the container after failure.

@edsantiago
Copy link
Member

Ugh. Thinking it over some more, I'm uncertain what "started successfully" means. I could argue that getting to the point where the container says "dude, no such command" is a successful execution of the container.

This is too tricky for me to think about at the end of a long week...

@mheon
Copy link
Member

mheon commented Dec 10, 2020

From everything we've done so far, I think the expectation is that autoremove always removes, even containers that error. Recommendation: we should retain existing behavior and just remove that bit from the manpage.

@rhatdan
Copy link
Member Author

rhatdan commented Dec 11, 2020

@containers/podman-maintainers PTAL
@mheon @edsantiago Tests are passing, we might as well work the same way in podman as podman-remote and remove the containers when start completes, whether it succeeds or fails.

@edsantiago
Copy link
Member

SGTM but I agree with @mheon: those two sentences need to be removed from the manpage.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

Code LGTM but I'd love a test or two.

podman start should follow the same behaviour as podman run when removing a
container.

Signed-off-by: Daniel J Walsh <[email protected]>
@TomSweeneyRedHat
Copy link
Member

LGTM
and happy green test buttons

@rhatdan rhatdan added the lgtm Indicates that a PR is ready to be merged. label Dec 12, 2020
@openshift-merge-robot openshift-merge-robot merged commit fbcd445 into containers:master Dec 12, 2020
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[flake] remote,rootless: create+start+ps: container does not exist in database
7 participants