Added stop signal to container termination logic and container status#11774
Conversation
|
Hi @sreeram-venkitesh. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
Left a comment on that PR. Unfortunately this is blocked until we can remove the go1.24 requirement from the CRI API module. |
ddf890c to
c9d4331
Compare
|
Rebased with the cri-api bump. I'll resume working on this PR again now. I need to add tests. |
9c69bdc to
7707926
Compare
7707926 to
a634070
Compare
|
@sreeram-venkitesh could you please rebase that change? thanks |
a634070 to
ae630fc
Compare
8f670c5 to
a8f0823
Compare
f37ab4d to
e989d97
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@mikebrow The tests are all passing finally! Copilot has reviewed the code too, I'm taking a look.. |
|
Any update on this change? |
|
I can take over this if need. |
|
nod let's help push this through.. just needs a gofmt, rebase, and if you have any issues you'd like to address @fuweid |
|
a lot of commits could you also squash pls.. at least the last one :) though some maintainers like to thin it down to standalone features that could be cherry picked individually. |
d6de978 to
625e7be
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var statusStopSignal runtime.Signal | ||
| stopsignal := container.Config.GetStopSignal() | ||
|
|
||
| if stopsignal == runtime.Signal_RUNTIME_DEFAULT { | ||
| if container.Metadata.StopSignal != "" { | ||
| statusStopSignal = toCRISignal(container.Metadata.StopSignal) | ||
| } else { | ||
| statusStopSignal = runtime.Signal_SIGTERM | ||
| } | ||
| } else { | ||
| statusStopSignal = stopsignal | ||
| } |
There was a problem hiding this comment.
toCRIContainerStatus uses toCRISignal(container.Metadata.StopSignal) whenever Metadata.StopSignal is non-empty. If the stored stop signal is something moby/sys/signal.ParseSignal accepts (e.g., TERM or a numeric value like 15 from an image config) but toCRISignal doesn’t recognize it, the status will end up reporting RUNTIME_DEFAULT instead of a concrete signal (or the default SIGTERM). Consider normalizing/validating the string (trim optional SIG prefix, uppercase, handle numeric via signal.ParseSignal) and/or falling back to SIGTERM when conversion fails.
625e7be to
a89225c
Compare
|
kindly ping @dmcgowan @samuelkarp for approval |
a89225c to
ef09699
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: sreeram-venkitesh <[email protected]> Signed-off-by: Wei Fu <[email protected]>
ef09699 to
1b1aba4
Compare
PR for #11617. Tests would fail since cri-api is not bumped to the latest version which has the API changes for stop signals in
ContainerConfigandContainerStatus.Waiting for #11763 to be merged so that I can rebase the cri-api update into this PR.