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

feat: support mountOptions in DeleteVolume #262

Merged

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Jan 2, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it:
feat: support mountOptions in DeleteVolume
since DeleteVolumeRequest does not have VolumeCapabilities field, this PR reads mountOptions from secret in DeleteVolume as a workaround.

  • create a secret with mountOptions
kubectl create secret generic mount-options --from-literal mountOptions="nfsvers=3"
  • define a storage class with csi.storage.k8s.io/provisioner-secret-name and csi.storage.k8s.io/provisioner-secret-namespace setting:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: nfs-csi
provisioner: nfs.csi.k8s.io
parameters:
  server: nfs-server.default.svc.cluster.local
  share: /
  csi.storage.k8s.io/provisioner-secret-name: "mount-options"
  csi.storage.k8s.io/provisioner-secret-namespace: "default"
reclaimPolicy: Delete
volumeBindingMode: Immediate
mountOptions:
  - hard
  - nfsvers=3

Which issue(s) this PR fixes:

Fixes #260

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

feat: support mountOptions in DeleteVolume

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 2, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 2, 2022
@coveralls
Copy link

coveralls commented Jan 2, 2022

Pull Request Test Coverage Report for Build 1647676395

  • 11 of 20 (55.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.8%) to 77.331%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/nfs/controllerserver.go 5 14 35.71%
Totals Coverage Status
Change from base Build 1645184398: -0.8%
Covered Lines: 539
Relevant Lines: 697

💛 - Coveralls

@andyzhangx andyzhangx changed the title [WIP]feat: support mountOptions in DeleteVolume feat: support mountOptions in DeleteVolume Jan 3, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 3, 2022
@andyzhangx andyzhangx merged commit 3b85b32 into kubernetes-csi:master Jan 3, 2022
@huanghantao
Copy link

Is there a new docker image to use this patch?

@andyzhangx
Copy link
Member Author

Is there a new docker image to use this patch?

@huanghantao try with following command, v3.1.0 is the latest image with this patch:

helm repo add csi-driver-nfs https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts
helm repo update
helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --version v3.1.0 --set image.nfs.pullPolicy=Always

@huanghantao
Copy link

Thank you, I can delete the PVC normally now!

@kwenzh
Copy link

kwenzh commented Mar 2, 2022

I've had this problem recently, i am using csi driver for nfs, i can delete the pvc normally now too
thank for your contribution,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
5 participants