-
Notifications
You must be signed in to change notification settings - Fork 177
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 support for attachment of inline volumes migrated to CSI #154
Conversation
Welcome @ddebroy! |
Signed-off-by: Deep Debroy <ddebroy@docker.com>
375a6e0
to
f478a77
Compare
/assign @saad-ali |
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.
great work on the implementation and testing for this! That's a lot of unit tests 😅
Implementation LGTM
pkg/controller/csi_handler.go
Outdated
if va.Spec.Source.InlineVolumeSpec.CSI != nil { | ||
csiSource = va.Spec.Source.InlineVolumeSpec.CSI | ||
} else { | ||
return va, nil, fmt.Errorf("inline volume spec contains nil CSI source") |
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.
nit: errors.New
for an error without args
@@ -888,12 +1049,12 @@ func TestCSIHandler(t *testing.T) { | |||
{ | |||
name: "detach invalid PV reference-> error", | |||
initialObjects: []runtime.Object{pvWithFinalizer(), node()}, | |||
addedVA: deleted(vaWithNoPVReference(va(true, fin, ann))), | |||
addedVA: deleted(vaWithNoPVReferenceNorInlineVolumeSpec(va(true, fin, ann))), |
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 we're missing a test where both PV
and InlineVolumeSpec
are set. Hate to make you write another test after already writing this massive amount, thanks for making sure this is all well tested!
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, we should have an unit test to cover this case. Otherwise I can't find anything wrong in this PR.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ddebroy, 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 |
Signed-off-by: Deep Debroy <ddebroy@docker.com>
Thanks for reviewing! Comments addressed. |
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds support in the external-attacher to handle volume attachments associated with inline volumes that do not have a regular PV associated with it.
Which issue(s) this PR fixes:
Special notes for your reviewer:
Related to kubernetes/kubernetes#77703
Does this PR introduce a user-facing change?: