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

remove service container _after_ pods #17003

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

vrothberg
Copy link
Member

@vrothberg vrothberg commented Jan 5, 2023

Do not allow for removing the service container unless all associated
pods have been removed. Previously, the service container could be
removed when all pods have exited which can lead to a number of issues.

Now, the service container is treated like an infra container and can
only be removed along with the pods.

Fixes: #16964
Signed-off-by: Valentin Rothberg [email protected]

Does this PR introduce a user-facing change?

Fix a bug where a pod couldn't be removed if its service container did not exist anymore.

@openshift-ci openshift-ci bot added release-note do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jan 5, 2023
@vrothberg vrothberg marked this pull request as ready for review January 5, 2023 13:04
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 5, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vrothberg

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 5, 2023
@vrothberg
Copy link
Member Author

@rhatdan @Luap99 PTAL

test/system/700-play.bats Outdated Show resolved Hide resolved
@rhatdan
Copy link
Member

rhatdan commented Jan 5, 2023

I agree we should treat this like an infra container, removing this with force removes the entire Pod

@vrothberg
Copy link
Member Author

I agree we should treat this like an infra container, removing this with force removes the entire Pod

OK. I will add another commit on top. Hope to find some time tomorrow.

@rhatdan rhatdan added the 4.4 label Jan 7, 2023
@vrothberg vrothberg changed the title remove pod if service container is already gone remove service container _after_ pods Jan 9, 2023
libpod/runtime_ctr.go Outdated Show resolved Hide resolved
libpod/runtime_ctr.go Show resolved Hide resolved
Do not allow for removing the service container unless all associated
pods have been removed.  Previously, the service container could be
removed when all pods have exited which can lead to a number of issues.

Now, the service container is treated like an infra container and can
only be removed along with the pods.

Also make sure that a pod is unlinked from the service container once
it's being removed.

Fixes: containers#16964
Signed-off-by: Valentin Rothberg <[email protected]>
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

@mheon
Copy link
Member

mheon commented Jan 9, 2023

/lgtm
/hold
Total success isn't green, but I think tests are rerunning and GH status just hasn't updated.

@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Jan 9, 2023
@vrothberg
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 9, 2023
@openshift-merge-robot openshift-merge-robot merged commit f7c9f93 into containers:main Jan 9, 2023
@vrothberg vrothberg deleted the fix-16964 branch January 9, 2023 16:09
@baude
Copy link
Member

baude commented Feb 3, 2023

/cherry-pick v4.4

@openshift-cherrypick-robot
Copy link
Collaborator

@baude: new pull request could not be created: failed to create pull request against containers/podman#v4.4 from head openshift-cherrypick-robot:cherry-pick-17003-to-v4.4: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"No commits between containers:v4.4 and openshift-cherrypick-robot:cherry-pick-17003-to-v4.4"}],"documentation_url":"https://docs.github.com/rest/reference/pulls#create-a-pull-request"}

In response to this:

/cherry-pick v4.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vrothberg
Copy link
Member Author

Sounds legit. This was merged before cutting the v4.4 branch, so it's included.

@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 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 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. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rarely Error: getting pod's service container: container {ID} not found in DB: no such container
8 participants