rook / nfs

Rook storage provider for NFS
Apache License 2.0
31 stars 10 forks source link

NFS Provisioner: Changing provisioned volume mode to 0777 #41

Closed hehesky closed 2 years ago

hehesky commented 2 years ago

Description of your changes:

Changing provisioned volume mode to 0777 by adding a chmod call after the dir is created

This is to allow non-root consumer pod to gain access to the volume. It is quite common now that pods are running as non-root user (sometimes even with restricted SCC). The consumer pod should be responsible for preparing the volume (i.e. changing the permission to proper values)

I also added on replace clause in go.mod otherwise it won't build (see #39).

Which issue is resolved by this Pull Request: Resolves https://github.com/rook/nfs/issues/22 and potentially a band-aid fix for https://github.com/rook/nfs/issues/39

I've tested this change using a dev build running on Openshift 4.8 with portworx backing the server. With this change non-root pods are able to mount provisioned volume and gain access.

Checklist: