Skip to content

Send container events with nil PodSandboxStatus#8047

Merged
dmcgowan merged 2 commits intocontainerd:mainfrom
ruiwen-zhao:send_nil
Feb 13, 2023
Merged

Send container events with nil PodSandboxStatus#8047
dmcgowan merged 2 commits intocontainerd:mainfrom
ruiwen-zhao:send_nil

Conversation

@ruiwen-zhao
Copy link
Copy Markdown
Member

@ruiwen-zhao ruiwen-zhao commented Feb 2, 2023

Signed-off-by: ruiwen-zhao [email protected]

This is a follow up action item of supporting Kubernete's Evented PLEG feature (kubernetes/enhancements#3386). Now that kubernetes/kubernetes#114351 merged, kubelet can handle nil PodSandboxStatus, containerd can send events with nil PodSandboxStatus.

Note that this PR also contains reverting part of #8007 (i.e. moving PLEG event generation back to sbserver) This is needed because we need the event generation to be in sbserver/ to be able to get PodSandboxStatus. More details in #8007 (comment).

fixes #7785

@k8s-ci-robot
Copy link
Copy Markdown

Hi @ruiwen-zhao. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@ruiwen-zhao
Copy link
Copy Markdown
Member Author

/assign @mikebrow

@ruiwen-zhao
Copy link
Copy Markdown
Member Author

ruiwen-zhao commented Feb 3, 2023

While working on this, I found a change of behavior introduced in #8007, which should have broken the test but didn't due to a bug in the test. I am reverting part of #8007 in this PR and fixing the bug in test as well.

cc @mxpv

@ruiwen-zhao
Copy link
Copy Markdown
Member Author

sync'ed with @mxpv on Slack.

With current implementation, the PLEG events are generated before sandboxstore.Add is called. So the event cannot get sandbox status by either calling cri.PodSandboxStatus or Controller.Status.

The conclusion here is that we will move the event generations back to sbserver/, and will move them to podsandbox package after sandboxstore.Add is moved to Controller.

@ruiwen-zhao ruiwen-zhao force-pushed the send_nil branch 2 times, most recently from 3e07297 to 765dcf3 Compare February 3, 2023 20:23
@samuelkarp
Copy link
Copy Markdown
Member

/ok-to-test

@samuelkarp samuelkarp added the area/cri Container Runtime Interface (CRI) label Feb 6, 2023
@samuelkarp samuelkarp self-assigned this Feb 6, 2023
@samuelkarp samuelkarp added this to the 1.7 milestone Feb 6, 2023
Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM with a hold for the k8s PR being cherry picked to v1.26.. otherwise a v1.7 containerd would throw an exception on v1.26.. We'll need to mention in our 1.7 docs the requirement for the v1.26 patched release.

@ruiwen-zhao
Copy link
Copy Markdown
Member Author

LGTM with a hold for the k8s PR being cherry picked to v1.26.. otherwise a v1.7 containerd would throw an exception on v1.26.. We'll need to mention in our 1.7 docs the requirement for the v1.26 patched release.

Thanks Mike. Created kubernetes/kubernetes#115552 to cherry pick.

Copy link
Copy Markdown
Member

@samuelkarp samuelkarp left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread pkg/cri/sbserver/helpers.go Outdated
Comment thread pkg/cri/server/helpers.go Outdated
Comment thread pkg/cri/server/helpers.go
@ruiwen-zhao
Copy link
Copy Markdown
Member Author

ruiwen-zhao commented Feb 10, 2023

LGTM with a hold for the k8s PR being cherry picked to v1.26.. otherwise a v1.7 containerd would throw an exception on v1.26.. We'll need to mention in our 1.7 docs the requirement for the v1.26 patched release.

@mikebrow kubernetes/kubernetes#115552 is now merged and will be released with 1.26.2. Can we get an approval on this PR?

Also the windows failure seems to be irrelevant

critest.exe : The term 'critest.exe' is not recognized as the name of a cmdlet, function, script file, or operable 
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At D:\a\_temp\[35](https://github.com/containerd/containerd/actions/runs/4129138934/jobs/7134499677#step:23:36)65d59b-178d-4c35-9457-7e4c1ead4ae5.ps1:11 char:1

Can we also get a re-test?

@mikebrow
Copy link
Copy Markdown
Member

/test all

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM on green..

@mikebrow
Copy link
Copy Markdown
Member

@ruiwen-zhao looks good but needs a rebase to pick up the main branch fix for a path issue with cri-tools .. they moved the location of the test executable .. sigh

@ruiwen-zhao
Copy link
Copy Markdown
Member Author

@ruiwen-zhao looks good but needs a rebase to pick up the main branch fix for a path issue with cri-tools .. they moved the location of the test executable .. sigh

uh thanks Mike! Somehow i was under the impression that github would rebase my change for me before running the tests.

Rebased on top of main.

@mikebrow
Copy link
Copy Markdown
Member

@ruiwen-zhao looks good but needs a rebase to pick up the main branch fix for a path issue with cri-tools .. they moved the location of the test executable .. sigh

uh thanks Mike! Somehow i was under the impression that github would rebase my change for me before running the tests.

Rebased on top of main.

it would for prow side k8s changes and any "latest" type project pulls, but not for the containerd/containerd changes as they are stowed in your branch

@samuelkarp
Copy link
Copy Markdown
Member

/test pull-containerd-sandboxed-node-e2e

@fuweid
Copy link
Copy Markdown
Member

fuweid commented Feb 11, 2023

@ruiwen-zhao I just merged the sandbox related change. Please rebase. Thanks

@samuelkarp
Copy link
Copy Markdown
Member

/test pull-containerd-sandboxed-node-e2e

@ruiwen-zhao
Copy link
Copy Markdown
Member Author

All tests have passed and corresponding kubelet change is merged and cherry-picked.

This PR should be OK to be merged.

@dmcgowan dmcgowan merged commit edb8eba into containerd:main Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cri Container Runtime Interface (CRI) ok-to-test

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Evented PLEG support] Do not filtering out container events with nil PodSandboxStatus

7 participants