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
storage validation: accept generic ephemeral volumes as volume device #105682
storage validation: accept generic ephemeral volumes as volume device #105682
Conversation
@pohly: 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 |
/lgtm |
/retest test flake |
/assign @smarterclayton For approval. |
01977a0
to
119725c
Compare
After considering potential merge conflicts (now and during backporting, should we decide to do that) my conclusion is that it should be safe to merge the E2E modifications in this PR. Then #105659 can be merged independently. I also added unit test cases. /cc @mauriciopoppe |
119725c
to
f75913e
Compare
/retest |
@@ -418,7 +418,8 @@ func IsMatchedVolume(name string, volumes map[string]core.VolumeSource) bool { | |||
|
|||
func isMatchedDevice(name string, volumes map[string]core.VolumeSource) (bool, bool) { |
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.
it's kinda hard to understand the return value without any comments :(, I read that it's used as didMatch, isPVC := isMatchedDevice(devName, volumes)
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.
That's how it was before, but I can of course enhance this while I am touching the code.
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.
Done. Please take another look.
@@ -297,6 +297,13 @@ var ( | |||
SnapshotType: DynamicCreatedSnapshot, | |||
SnapshotDeletionPolicy: DeleteSnapshot, | |||
} | |||
// BlockVolModeGenericEphemeralVolume is for generic ephemeral inline volumes in raw block mode. | |||
BlockVolModeGenericEphemeralVolume = TestPattern{ | |||
Name: "Generic Ephemeral-volume (block volmode) (late-binding)", |
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'm not sure about what's our rule to add tags, e.g. [Feature:x]
vs (block volmode)
or (late-binding)
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.
Round brackets are just comments. They have no special meaning.
if framework.NodeOSDistroIs("windows") { | ||
command = "ls /mnt/test* && sleep 10000" | ||
} | ||
command := "sleep 10000" |
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.
Is there a reason we're not checking in the Pod command that the paths were mounted? I'm not sure why this command would need to change for block volumes
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.
Block volumes don't get mounted.
The code here could have been made more intelligent, but it was already redundant (the same mount check is done also in individual tests), so I decided to simplify here.
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.
A few comments about the pattern name and the TestEphemeral
command change
Raw block devices are possible with generic ephemeral volumes, so rejecting a pod with that combination is wrong.
This adds a new test pattern and uses it for the inline volume tests. Because the kind of volume now varies more, validation of the mount or block device is always done by the caller of TestEphemeral.
f75913e
to
a90a3c6
Compare
Thanks for addressing the comments |
@smarterclayton: PR is ready for approval... |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pohly, thockin 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 |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Raw block devices are possible with generic ephemeral volumes, so rejecting a
pod with that combination is wrong.
Special notes for your reviewer:
Found while working on E2E tests. Here's an example of a failures from those tests: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/105659/pull-kubernetes-e2e-gce-csi-serial/1448711002941034496/
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: