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

e2e_node: add a test to verify kubelet fails to create pod if userns isn't supported #127484

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

Conversation

haircommander
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

... and the pod requests a user namespace

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

none

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 19, 2024
@haircommander
Copy link
Contributor Author

/hold

requires kubernetes/test-infra#33511 to actually run

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: haircommander
Once this PR has been reviewed and has the lgtm label, please assign sjenning for approval. For more information see the Kubernetes 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 do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. area/test sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 19, 2024
…isn't supported

and the pod requests a user namespace

Signed-off-by: Peter Hunt <pehunt@redhat.com>
@haircommander
Copy link
Contributor Author

/test pull-kubernetes-node-crio-cgrpv2-userns-e2e-serial

@bart0sh
Copy link
Contributor

bart0sh commented Sep 19, 2024

/triage accepted
/priority important-soon

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 19, 2024
@kannon92
Copy link
Contributor

/hold

Let's confirm that the test you added works before merge.

@k8s-ci-robot
Copy link
Contributor

@haircommander: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-node-crio-cgrpv2-userns-e2e-serial bbcea1c link false /test pull-kubernetes-node-crio-cgrpv2-userns-e2e-serial

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.

@haircommander
Copy link
Contributor Author

/hold cancel

new test passed https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/127484/pull-kubernetes-node-crio-cgrpv2-userns-e2e-serial/1836871735580823552 some other test that's now in this suite failed, but that shouldn't block IMO

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 20, 2024
admissionapi "k8s.io/pod-security-admission/api"
)

var _ = SIGDescribe("UserNamespaces", "[LinuxOnly]", nodefeature.UserNamespacesSupport, framework.WithSerial(), func() {
Copy link
Member

Choose a reason for hiding this comment

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

is this test really serial?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, when ever a feature gate is toggled for kubelet, the test has to be serial. Changing kubelet configs triggers a restart of kubelet.

Copy link
Member

Choose a reason for hiding this comment

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

Til, thanks, this explains why some test here are tagged as serial when they are not ..., authors may forget to remove the serial decorator when it is ga .... @pohly does it make sense to automate this behavior for the e2e_node so authors don't need to worry about this behavior?

cc @SergeyKanzhelev

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see how. nodefeature.UserNamespacesSupport just says "this test depends on this feature", it doesn't say "this test needs to toogle that feature", so nodefeature.UserNamespacesSupport should not implicitly add the serial tag.

authors may forget to remove the serial decorator when it is ga

Doesn't it say below that the entire test needs to be removed once the feature is GA?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah this test is only serial because it changes the kubelet's feature gates, not specifically toggles user namespaces. Once user namespaces are GA'd (and specifically when the feature gate is dropped), we have to remove this test because we can't test with user namespaces disabled anymore


// Pod should stay in pending
// Events would be a better way to tell this, as we could actually read the event,
// but history proves events aren't reliable enough to base a test on.
Copy link
Member

Choose a reason for hiding this comment

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

v1.Events? those must no be used on tests, are best effort , there is no guarantee there are going to be delivered

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exactly

@kannon92
Copy link
Contributor

/hold cancel

new test passed https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/127484/pull-kubernetes-node-crio-cgrpv2-userns-e2e-serial/1836871735580823552 some other test that's now in this suite failed, but that shouldn't block IMO

Is this an existing test failure?

@haircommander
Copy link
Contributor Author

Is this an existing test failure?

TBH I don't think that test was being tested before I converted userns job to serial+userns job

@SergeyKanzhelev
Copy link
Member

Is this an existing test failure?

TBH I don't think that test was being tested before I converted userns job to serial+userns job

Are you working on fixing those?

@pacoxu pacoxu mentioned this pull request Oct 14, 2024
8 tasks
@pacoxu
Copy link
Member

pacoxu commented Oct 14, 2024

The failing test is about LocalStorageCapacityIsolationQuota. I opened #128042 to track it.

@pacoxu
Copy link
Member

pacoxu commented Oct 15, 2024

/hold

Let's confirm that the test you added works before merge.

@kannon92 I submit a PR to fix the failure #128074.

Can we unhold this?

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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: PRs - Needs Reviewer
Development

Successfully merging this pull request may close these issues.

8 participants