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

core/runtime: Check shim PluginInfo to enforce idmap support #9781

Merged
merged 1 commit into from
May 3, 2024

Conversation

rata
Copy link
Contributor

@rata rata commented Feb 7, 2024

This commit gets rid of the TODO by moving the check to use the pluginInfo() infrastructure (#9442).

The check is only enforced for shims that return info that can be read as type runtime.Features. For shims that don't provide that, we just ignore it, as those shims might not be affected by this.

NOTE: Since Kubernetes 1.30, the kubelet checks that the container runtime supports all the features for user namespaces (iow, it checks idmap mounts support too) and, if the runtime doesn't support them, it just rejects the pod creation without sending it to the runtime. That makes it less of an issue, as this PR is not really needed now for kubernetes >= 1.30 workloads. However, it is the right thing to do (we shouldn't rely on k8s doing it, we should check it here too), and it is still relevant for kubernetes < 1.30 and workloads not using Kubernetes.

cc @AkihiroSuda

@k8s-ci-robot
Copy link

Hi @rata. 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.

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.

@rata rata force-pushed the rata/userns-use-pluginInfo branch 2 times, most recently from d21884d to 9243ae1 Compare February 7, 2024 12:19
@rata rata force-pushed the rata/userns-use-pluginInfo branch 2 times, most recently from 51bb4e7 to 39dcd52 Compare February 7, 2024 13:20
@rata
Copy link
Contributor Author

rata commented Feb 7, 2024

The unrelated flake is gone now. All green :)

@rata
Copy link
Contributor Author

rata commented Feb 7, 2024

@AkihiroSuda can you add the ok-to-test ? I think that kicks the k8s tests

@AkihiroSuda
Copy link
Member

/ok-to-test

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

core/runtime/v2/manager.go Outdated Show resolved Hide resolved
@rata rata force-pushed the rata/userns-use-pluginInfo branch from 39dcd52 to 78396c6 Compare February 22, 2024 16:59
@fuweid fuweid requested a review from AkihiroSuda April 23, 2024 11:00
@AkihiroSuda AkihiroSuda enabled auto-merge May 3, 2024 10:47
auto-merge was automatically disabled May 3, 2024 10:48

Head branch was pushed to by a user without write access

@rata rata force-pushed the rata/userns-use-pluginInfo branch 4 times, most recently from c1cbfdf to f1908cf Compare May 3, 2024 11:20
@rata
Copy link
Contributor Author

rata commented May 3, 2024

Pushing to solve unrelated CI failures in vagrant (I've also removed some blank lines and improve some comments/error msgs, very minor details really).

@rata rata force-pushed the rata/userns-use-pluginInfo branch from f1908cf to 8fbf14d Compare May 3, 2024 12:19
This commit gets rid of the TODO by moving the check to use the
pluginInfo() infrastructure.

The check is only enforced for shims that return info that can be read
as type runtime.Features. For shims that don't provide that, we just
ignore it, as those shims might not be affected by this.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
@rata rata force-pushed the rata/userns-use-pluginInfo branch from 8fbf14d to f1e265b Compare May 3, 2024 13:01
@rata
Copy link
Contributor Author

rata commented May 3, 2024

The k8s failure seems a flake too, it was passing just fine until now. Also, I can't see any logs from the failure, maybe something is broken on the k8s CI?

@rata
Copy link
Contributor Author

rata commented May 3, 2024

/retest

1 similar comment
@rata
Copy link
Contributor Author

rata commented May 3, 2024

/retest

@rata
Copy link
Contributor Author

rata commented May 3, 2024

@AkihiroSuda all green now! Please LGTM again or merge :D

@rata
Copy link
Contributor Author

rata commented May 3, 2024

@fuweid maybe you can LGTM again/merge too? :)

@AkihiroSuda AkihiroSuda added this pull request to the merge queue May 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 3, 2024
@rata
Copy link
Contributor Author

rata commented May 3, 2024

@AkihiroSuda this was removed from the merge queue due to an issue in CI. Can you merge or put it again? AFAIK, the issue is really unrelated to this PR (no behavior is changed here, we change where we do this check).

@AkihiroSuda AkihiroSuda added this pull request to the merge queue May 3, 2024
Merged via the queue into containerd:main with commit ef12da2 May 3, 2024
47 checks passed
@rata rata deleted the rata/userns-use-pluginInfo branch May 14, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants