-
Notifications
You must be signed in to change notification settings - Fork 50
Description
I'm trying to mount a bucket in a pod specify the permission bits like this:
apiVersion: v1
kind: Pod
metadata:
name: gcs-fuse-csi-example-ephemeral
namespace: default
annotations:
gke-gcsfuse/volumes: "true"
spec:
terminationGracePeriodSeconds: 60
containers:
- image: busybox
name: busybox
command: ["sleep"]
args: ["infinity"]
volumeMounts:
- name: gcs-fuse-csi-ephemeral
mountPath: /data
serviceAccountName: gke-gcs-sa
volumes:
- name: gcs-fuse-csi-ephemeral
csi:
driver: gcsfuse.csi.storage.gke.io
volumeAttributes:
bucketName: just-a-random-bucket-name
mountOptions: "implicit-dirs,file-system:dir-mode:777,file-system:file-mode:666" The permission bits are specified in octal according to the documentation, 777 and 666.
The bucket is not mounted and I see following error in the logs.
Error while mounting gcsfuse: mountWithStorageHandle: fs.NewServer: create file system: illegal file perms: --w--wx-w-Debugging this I found out that the issue is that the driver is creating the config file as follows
file-system:
dir-mode: 777
file-mode: 666 According to the documentation the permission bits should be in octal as string and not as numbers and the config file should look like this:
file-system:
dir-mode: "777"
file-mode: "666" The only workaround that I could find was to use the decimal number instead of the octal number.
For example 511 instead of 777 and 438 instead of 666.
...
mountOptions: "implicit-dirs,file-system:dir-mode:511,file-system:file-mode:438"
...and works but this is not user friendly at it and does not respect the documentation.
I can create a PR to properly write the config file if this is accepted as the solution.