-
Notifications
You must be signed in to change notification settings - Fork 39.1k
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
CSI - Implementation for Inline Volume Support #68232
CSI - Implementation for Inline Volume Support #68232
Conversation
/assign |
/status approved-for-milestone |
You must be a member of the kubernetes/kubernetes-milestone-maintainers github team to add status labels. |
still gonna make it for 1.12? |
Is this possible for 1.13? |
@kfox1111 this is targeting 1.13 |
Ok. Thanks for the update. :) |
/cc @davidz627 |
@vladimirvivien will this be behind an alpha feature flag for 1.13? |
/assign @davidz627 please review at your earliest convenience.. |
@sbezverk @vladimirvivien is it possible to split this PR into a couple focused commits? For example 1 for api changes, 1 for implementation changes, 1 for test changes, and 1 for autogenerated files changes? This would make it 10x easier to review. As it stands its fairly difficult to sift through all the files on Github and pick out whats important |
@davidz627 We'll get that going. |
/test pull-kubernetes-integration |
@davidz627 PTAL |
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.
just reviewed the non-test implementation commit
pkg/volume/csi/csi_attacher.go
Outdated
driverName = pvSource.Driver | ||
skip, err := c.plugin.skipAttach(driverName) | ||
if err != nil { | ||
klog.Error(log("attacher.Attach failed to find if driver is attachable: %v", err)) |
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: I don't think we should be logging errors everytime right before we return an error. If we return the error the caller should be logging it somewhere
pkg/volume/csi/csi_attacher.go
Outdated
if c.plugin.inlineFeatureEnabled && volSource != nil { | ||
driverName = volSource.Driver | ||
if volSource.VolumeHandle != nil { | ||
volumeHandle = *volSource.VolumeHandle |
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 is this one a pointer that needs a nil check whereas the volumeHandle
in pvSource
is just a string
pkg/volume/csi/csi_attacher.go
Outdated
return "", nil | ||
|
||
// post attachment object and wait for attachment to be created | ||
createdAttchID, err := c.postVolumeAttachment(driverName, volumeHandle, attachment, csiDefaultTimeout) |
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: spelling createdAttachID
pkg/volume/csi/csi_attacher.go
Outdated
return "", nil | ||
|
||
// post attachment object and wait for attachment to be created | ||
createdAttchID, err := c.postVolumeAttachment(driverName, volumeHandle, attachment, csiDefaultTimeout) |
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.
post
is an overloaded word and means something fairly specific. Is that what we're doing? Or is this more of a CreateVolumeAttachment type deal
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.
Yeah, I think this is a create volume attachment thing. post as in http method=post.
pkg/volume/csi/csi_attacher.go
Outdated
klog.V(4).Info(log("attacher.WaitForAttach called [attachment.ID=%v]", attachID)) | ||
if spec == nil { | ||
klog.Error(log("attacher.WaitForAttach missing volume.Spec")) | ||
return "", errors.New("missing spec") |
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 would prefer we don't log errors here again, and please put the better error message into the error that is returned, this will then get logged by the caller
pkg/volume/csi/csi_plugin.go
Outdated
} | ||
|
||
func (p *csiPlugin) CanSupport(spec *volume.Spec) bool { | ||
// TODO (vladimirvivien) CanSupport should also take into account | ||
// the availability/registration of specified Driver in the volume source | ||
return spec.PersistentVolume != nil && spec.PersistentVolume.Spec.CSI != nil | ||
if p.inlineFeatureEnabled { | ||
return (spec.PersistentVolume != nil && spec.PersistentVolume.Spec.CSI != nil) || |
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.
if we're doing inline why are we checking whether PersistentVolume is not nil either? We specifically want Persistent volume to be nil actually?
pkg/volume/csi/csi_plugin.go
Outdated
sourceKind string | ||
) | ||
|
||
if volSource != nil && p.inlineFeatureEnabled { |
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.
also could use that common function
pkg/volume/csi/csi_plugin.go
Outdated
var spec *volume.Spec | ||
|
||
if p.inlineFeatureEnabled && volData[volDataKey.sourceKind] == volumeKind { | ||
handle := volData[volDataKey.volHandle] |
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.
unclear to me why we're using this volData
map instead of passing variables around. This seems much more brittle, especially since nowhere in this function do we check for the values in the map already existing.
If we MUST use the map, we should do nil checks and fail fast if the values are not there
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 am not as familiar with API's so someone else should review this, but I have added some simple comments
@rthallisey pr that I think will interest kubevirt for container images. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vladimirvivien If they are not already assigned, you can assign the PR to them by writing 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 |
@vladimirvivien: The following tests failed, say
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/test-infra repository. I understand the commands that are listed here. |
Apologies for confusion. Closing this PR because of a lot of outdated comments and due to changes in implementation. Moving API review here #74086 |
Closing this PR because of a lot of old outdated comments due to changes in implementation. Moving API changes here #74086 |
What this PR does / why we need it:
This PR is the implementation of the API changes and CSI code needed to support CSI inline volume.
See also
Release note:
/SIG storage
The new design contains substantial changes. Closing this PR to avoid carrying around massive amount of old irrelevant and unrelated comments. PR for new API changes is #74086.