Skip to content
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

driver: validate capabilities for volume creation #68

Merged
merged 1 commit into from
Aug 27, 2018
Merged

Conversation

fatih
Copy link
Contributor

@fatih fatih commented Aug 23, 2018

We don't validate the capabilities during CreateVolume(). We should
start doing it to avoid creating volumes that need to be in different
modes, such as MULTI_NODE_MULTI_WRITER (ReadWriteMany in k8s) or
MULTI_NODE_READER_ONLY (ReadOnlyMany in k8s)

Note that, there is a bug in the external-provisioner sidecar that passes down the Kubernetes accessModes fields to the CSI plugin. It currently passes a hardcoded value of SINGLE_NODE_WRITER (see: https://github.com/kubernetes-csi/externalprovisioner/blob/4d8a86cc54901d4d14b56c03a6ee7dfe6482c9b1/pkg/controller/controller.go#L89), so this means currently it's not possible to create volumes with ReadWriteMany or ReadOnlyMany nevertheless.

But it's good we have the check in place, so we're protected once the
issue in the provisioner is fixed in the future.

closes #42

@lxfontes
Copy link

lgtm

We don't validate the capabilities during `CreateVolume()`. We should
start doing it to avoid creating volumes that needs to be in different
modes, such as `MULTI_NODE_MULTI_WRITER` (ReadWriteMany in k8s) or
`MULTI_NODE_READER_ONLY` (ReadOnlyMany in k8s)

Note that, there is a
[bug](kubernetes-csi/external-provisioner#117)
in the `external-provisioner` sidecar that passes down the Kubernetes
`accessModes` fields to the CSI plugin. It currently passes a hardcoded
value of `SINGLE_NODE_WRITER` (see:
https://github.com/kubernetes-csi/external-provisioner/blob/4d8a86cc54901d4d14b56c03a6ee7dfe6482c9b1/pkg/controller/controller.go#L89),
so this means currently it's not possible to create volumws with
`ReadWriteMany` or `ReadOnlyMany` nevertheless.

But it's good we have the check in place, so we'de protected once the
issue in the provisioner is fixed in the future.

closes #42
@fatih fatih merged commit 4bed4b4 into master Aug 27, 2018
@fatih fatih deleted the readwrite branch August 27, 2018 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reject claims with ReadWriteMany
2 participants