-
Notifications
You must be signed in to change notification settings - Fork 336
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
Cache driver name #215
Cache driver name #215
Conversation
Provisioner should not ask for it every time, it should not change during driver container lifetime.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
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 two nits not really related to your code change but since you touched those areas I took the opportunity to ask some questions. besides those, LGTM
} | ||
return provisioner | ||
} | ||
|
||
// This function get called before any attempt to communicate with the driver. | ||
// Before initiating Create/Delete API calls provisioner checks if Capabilities: | ||
// PluginControllerService, ControllerCreateVolume sre supported and gets the driver name. | ||
func checkDriverState(grpcClient *grpc.ClientConn, timeout time.Duration, needSnapshotSupport bool) (*driverState, error) { | ||
func checkDriverCapabilities(grpcClient *grpc.ClientConn, timeout time.Duration, needSnapshotSupport bool) (sets.Int, error) { |
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 we representing capabilities with sets.Int
, is there no named type from the protobuf we can use? if not, can we define one
type PluginCapabilitiesType sets.Int
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 tried, but then I loose all sets.Int
methods (no PluginCapabilitiesType.Has
). I could restore driverState
struct (with a better name) with sets.Int
as a field, but that looks ugly.
@@ -145,7 +144,7 @@ func init() { | |||
|
|||
// Create the provisioner: it implements the Provisioner interface expected by | |||
// the controller | |||
csiProvisioner := ctrl.NewCSIProvisioner(clientset, csiAPIClient, *csiEndpoint, *connectionTimeout, identity, *volumeNamePrefix, *volumeNameUUIDLength, grpcClient, snapClient) | |||
csiProvisioner := ctrl.NewCSIProvisioner(clientset, csiAPIClient, *csiEndpoint, *connectionTimeout, identity, *volumeNamePrefix, *volumeNameUUIDLength, grpcClient, snapClient, provisionerName) |
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.
provisionerName == driverName
? why do we even have these two concepts then. Can we just call it driverName
everywhere?
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 it's mandatory for volume topology, where kubelet knows just driver name from driver registrar and scheduler knows only provider name from StorageClass. @msau42 knows details.
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.
Yes, they're the same. external-provisioner originally was implemented allowing them to be different but there's no reason they need to be so we removed it in #186
/lgtm |
Provisioner should not ask for it every time, it should not change during driver container lifetime.