-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Terminate restartable init containers ignoring not-started containers #125935
Conversation
/priority important-soon |
return false, nil | ||
} | ||
containerStatus := pod.Status.InitContainerStatuses[1] | ||
return containerStatus.State.Running != nil, nil |
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.
You might also want to check if the startup probe failed.
return containerStatus.State.Running != nil, nil | |
return containerStatus.State.Running != nil && containerStatus.Ready == false, nil |
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.
fixed to check that the containerStatus.Started is not true
/test pull-kubernetes-node-e2e-containerd-features |
/test pull-kubernetes-node-e2e-containerd-features |
@gjkim42: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
This ensures that the restartable init containers receive a termination signal even if there are any not-started restartable init containers, by ignoring the not-running containers.
/test pull-kubernetes-cos-cgroupv2-containerd-node-e2e-features |
|
||
// if it's not a running container, pre-close the channel so nothing | ||
// waits on it | ||
if _, isRunning := runningContainers[ic.Name]; !isRunning { |
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.
nice
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.
/lgtm
LGTM label has been added. Git tree hash: 93ff42ea9e1ee9003dcf14fd15b677da28dfcaf9
|
Hello, forgive my nativity in the release process for kubernetes! |
for 1.30 it will probably be cherry-picked |
OK thanks @matthyx - will look into a workaround then! |
sorry, I replied too quickly, in 1.29 we were already beta: https://github.com/kubernetes/enhancements/blob/eb0b9a29ecf680fde9a02fdb79aa4ce89bb4dd0a/keps/sig-node/753-sidecar-containers/kep.yaml#L39C7-L39C16 so 1.30 and 1.29 should be cherry-picked |
/triage accepted |
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.
/lgtm
/approve
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gjkim42, matthyx, SergeyKanzhelev, yujuhong 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 |
we need a cherry pick for 1.29 and 1.30 here |
I'll make PRs for them. |
…935-upstream-release-1.29 Automated cherry pick of #125935: Terminate restartable init containers ignoring not-started containers
…935-upstream-release-1.30 Automated cherry pick of #125935: Terminate restartable init containers ignoring not-started containers
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently, the restartable init container (native sidecar container) may not receive SIGTERM if the last restartable init container hasn't run.
This PR ensures that the restartable init containers receive a termination signal even if there are any not-started restartable init containers, by ignoring the not-running containers.
Which issue(s) this PR fixes:
Fixes #125880
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: