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

use container restart policy if user specifies one #19676

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Aug 18, 2023

Fixes: #19671

Does this PR introduce a user-facing change?

If restart policy is specified for container in a pod, then use it rather then the pods restart policy.

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 18, 2023
Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

I think this should be other way around, all containers must inherit pod policy only and default pod-policy should be Always. See:https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy

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.

Changes LGTM

Another reminder to write commit messages.

@vrothberg
Copy link
Member

I think this should be other way around, all containers must inherit pod policy only and default pod-policy should be Always. See:https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy

That's not how it was designed. We wanted a container to always by able to override the restart policy if explicitly set by the user and otherwise inherit the pod's default.

Note that this is podman pod ... not podman kube ....

@rhatdan
Copy link
Member Author

rhatdan commented Aug 21, 2023

Yes in Kubernetes world, I don't think a container can specify a restart policy in the kube.yaml. In Pod's though they can so we should honor the more specific setting.

@flouthoc ^^

@containers/podman-maintainers PTAL

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

LGTM , I confused between podman kube and podman pod
/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, 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-merge-robot openshift-merge-robot merged commit 93f194c into containers:main Aug 21, 2023
@vrothberg
Copy link
Member

/cherry-pick v4.6

@openshift-cherrypick-robot
Copy link
Collaborator

@vrothberg: new pull request created: #19682

In response to this:

/cherry-pick v4.6

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.

@TomSweeneyRedHat
Copy link
Member

@vrothberg Please cherry-pick to Podman v4.6.1-rhel ASAP. Two BZ's spun your way to allow for that. https://bugzilla.redhat.com/show_bug.cgi?id=2233222 and https://bugzilla.redhat.com/show_bug.cgi?id=2233218

@mheon
Copy link
Member

mheon commented Aug 21, 2023

/cherry-pick v4.6.1-rhel

@openshift-cherrypick-robot
Copy link
Collaborator

@mheon: new pull request created: #19692

In response to this:

/cherry-pick v4.6.1-rhel

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.

@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 Nov 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 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.

Containers created with --restart=always do not restart when started through a pod
7 participants