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

reject PVCs with volumeMode block #605

Merged
merged 2 commits into from
Mar 23, 2023

Conversation

fungaren
Copy link
Contributor

As explained in Kubernetes CSI Developer Documentation, we should check for the VolumeCapabilities as Kubernetes will not call ValidateVolumeCapabilities before CreateVolume. So we should check if the volumeMode is Block and if so, reject it.

Close #604

$ kubectl get pvc
NAME                  STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS          AGE
juicefs-root-bucket   Bound     pvc-71eea69d-cafc-47ca-9477-8c1b0b533ba0   10Pi       RWX            juicefs-root-bucket   11s
should-fail-pvc       Pending
E0321 07:08:29.886388       7 driver.go:96] GRPC error: rpc error: code = InvalidArgument desc = Volume Capabilities not fully supported

@zwwhdls
Copy link
Member

zwwhdls commented Mar 21, 2023

Thanks for your contribution a lot! @fungaren

Can you fix the unit test?

@fungaren
Copy link
Contributor Author

fungaren commented Mar 22, 2023

@zwwhdls Done. By the way, it is supposed to upgrade to gomonkey/v2 because it compiles failed in my machine. And must disable inlining by flag -gcflags=-l (below go1.10) or -gcflags=all=-l (go1.10 and above) to run the tests. And don't forget to run go mod tidy as well.

@zwwhdls
Copy link
Member

zwwhdls commented Mar 23, 2023

@fungaren , thanks! Which version of golang do you use? And will you fix it?

@zwwhdls zwwhdls merged commit fba0a3a into juicedata:master Mar 23, 2023
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.

[BUG] Should reject PVC with volumeMode: Block
2 participants