-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
Add multi-pod tests with SELinux mounts #113789
Conversation
@jsafrane: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
/sig storage |
cc @gnufied |
The verify failure looks legit:
|
@jsafrane if you need this to land in 1.26, please fix the problem in the verify log and get approval/lgtm! |
marked as WIP, it does not need to catch 1.26 |
eb354ba
to
b2fd027
Compare
Rebased & updated & removed WIP |
If you still need this PR then please rebase, if not, please close the PR |
There is nothing to rebase. I updated the PR 4 days ago and I still want it in 1.27. /retest
|
b2fd027
to
261aa14
Compare
261aa14
to
1b1d4b7
Compare
I did non-trivial rebase +
|
1b1d4b7
to
39419d2
Compare
Check that a volume is fully unmounted (Unstaged) before kubelet starts a pod with the same volume, but with a different SELinux context.
39419d2
to
e1f62a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error strings look good to me, just some minor comments.
test/e2e/storage/csi_mock/base.go
Outdated
mountVolume := nodePublishRequest.GetVolumeCapability().GetMount() | ||
if mountVolume != nil { | ||
*nodePublishMountOpts = mountVolume.MountFlags | ||
} | ||
} | ||
_, ok = request.(*csipbv1.NodeUnstageVolumeRequest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing error handling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the code is correct, still, I rewrote it to switch request.(type)
to be more obvious.
test/e2e/storage/csi_mock/base.go
Outdated
if ok { | ||
unstageCalls.Add(1) | ||
} | ||
_, ok = request.(*csipbv1.NodeUnpublishVolumeRequest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here?
}) | ||
ginkgo.DeferCleanup(m.cleanup) | ||
defer m.cleanup(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you reverting to using defer
here?
It will not be able to clean up when the test gets interrupted because then ctx
will be canceled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, using DeferCleaup
now
|
||
// Skip scheduler, it would block scheduling the second pod with ReadWriteOncePod PV. | ||
pod, err = m.cs.CoreV1().Pods(pod.Namespace).Get(ctx, pod.Name, metav1.GetOptions{}) | ||
framework.ExpectNoError(err, fmt.Sprintf("getting the initial pod")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for fmt.Sprintf
: there's nothing to format, and even if there was, ExpectNoError
could be passed a format string plus parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Replace it with ginkgo.DeferCleanup
All three failed this test: /retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
/lgtm |
LGTM label has been added. Git tree hash: 87da4005167590625f91f021f39fae471f56191c
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnufied, jsafrane The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
(?)
What this PR does / why we need it:
Add test to check that a volume is fully unmounted (
NodeUnstaged
) before kubelet starts a pod with the same volume, but with a different SELinux context.Does this PR introduce a user-facing change?
kubernetes/enhancements#3548