Skip to content

KEP-3619: Run SupplementalGroupsPolicy e2e test in CI Jobs #130956

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

everpeace
Copy link
Contributor

@everpeace everpeace commented Mar 20, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR enables CI jobs to pick up SupplementalGroupsPolicy e2e tests.
SupplementalGroupsPolicy e2e test can gracefully skip in either case when the CRI runtime does or does not support this feature (the test cases implement both cases in graceful manner).

ref: #130210 (comment)

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 20, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/test labels Mar 20, 2025
@everpeace
Copy link
Contributor Author

/test all

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Mar 20, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Mar 20, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: everpeace
Once this PR has been reviewed and has the lgtm label, please assign random-liu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 21, 2025
@everpeace everpeace marked this pull request as ready for review March 21, 2025 14:35
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 21, 2025
@k8s-ci-robot k8s-ci-robot requested a review from sjenning March 21, 2025 14:35
Copy link
Contributor Author

@everpeace everpeace left a comment

Choose a reason for hiding this comment

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

/assign @BenTheElder @pohly
would you mind reviewing this small PR? 🙇 🙇

@@ -714,7 +714,7 @@ var _ = SIGDescribe("Security Context", func() {
})
})

f.Context("SupplementalGroupsPolicy [LinuxOnly]", feature.SupplementalGroupsPolicy, framework.WithFeatureGate(features.SupplementalGroupsPolicy), func() {
f.Context("SupplementalGroupsPolicy [LinuxOnly]", framework.WithFeatureGate(features.SupplementalGroupsPolicy), func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The "gracefully skip" part of your description raises an alarm bell for me.

See https://github.com/kubernetes/kubernetes/pull/130210/files#r2007744517.

IMHO we should only select tests in jobs which are expected to run, and tests should fail if they cannot run.

Copy link
Contributor

Choose a reason for hiding this comment

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

To do that, keep the feature.SupplementalGroupsPolicy, identify the jobs which support it, change them to --label-filter=Feature: isSubsetOf { SupplementalGroupsPolicy, ... }, and remove the runtime skip from the test.

Copy link
Contributor Author

@everpeace everpeace Mar 21, 2025

Choose a reason for hiding this comment

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

Thanks for the comment.

IMHO we should only select tests in jobs which are expected to run, and tests should fail if they cannot run.

Yeah, I agreed, ideally.

identify the jobs which support it, change them to --label-filter=Feature: isSubsetOf { SupplementalGroupsPolicy, ... }, and remove the runtime skip from the test.

Currently, it seems we currently don't have e2e jobs with old containerd < v2 (which does not support this feature). So, in this case, do you mean to create a new dedicated job for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

So the feature needs containerd >= v2 and wouldn't run with some older containerd? Then you don't need to add a job with containerd < 2 because the feature doesn't need to be tested with it.

Copy link
Contributor Author

@everpeace everpeace Mar 24, 2025

Choose a reason for hiding this comment

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

So the feature needs containerd >= v2 and wouldn't run with some older containerd?

Esseentially, yes.

But, there is a corner case, kubelet should now rejects pod creations for pods with pod.spec.securityContext.supplementalGroupsPolicy: Strict on such nodes(older containerd, i.e.node.status.features.supplementalGroupsPoliycy: false) and issues events for the rejections. So, I wrote a testcase for it.

Please also refer to https://github.com/kubernetes/website/blob/dev-1.33/content/en/docs/tasks/configure-pod-container/security-context.md#implementations-implementations-supplementalgroupspolicy (v1.33's document for this feature).

I'm not sure how to handle this corner case in CI Jobs with handy way. I actually felt that introducing a new CI Job was too much only for this case.

These runtime skips are dangerous.

I agree your warning. So, now I'm leaning to remove test cases for old CRI runtimes that does not support this feature from E2E test.

WDYT??

Let me ping to KEP-3619 reviewers to have reviewers' feedbacks:
cc/ @haircommander @mrunalp @SergeyKanzhelev @thockin (KEP reviewers)

Copy link
Member

Choose a reason for hiding this comment

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

If this was aimed at [Conformance] and not [NodeConformance] (NodeConformance is not an official output from sig arch / CNCF etc) then this sort of thing would be a problem, I'm less clear for [NodeConformance].

Self-skips are definitely surprising, but sprinkling ~all of our jobs with this transitional "feature" isn't great either, and also isn't feasible for jobs still using regex (And I don't think we're quite ready to convert everything to label filter yet)

Copy link
Member

Choose a reason for hiding this comment

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

cc @aojea

@SergeyKanzhelev
Copy link
Member

/assign

@SergeyKanzhelev
Copy link
Member

/cc @ajaysundark

@k8s-ci-robot
Copy link
Contributor

@SergeyKanzhelev: GitHub didn't allow me to request PR reviews from the following users: ajaysundark.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @ajaysundark

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.

@SergeyKanzhelev SergeyKanzhelev moved this from Triage to PRs - Needs Reviewer in SIG Node CI/Test Board Mar 26, 2025
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 25, 2025
@bart0sh bart0sh moved this from Triage to Needs Reviewer in SIG Node: code and documentation PRs Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
Status: PRs - Needs Reviewer
Development

Successfully merging this pull request may close these issues.

6 participants