diff --git a/README.md b/README.md index 3836f9e..26e25e9 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Assuming a `//192.168.56.101/TEST` cifs share, accessible by a `TESTER` user wit 1. create secret to access the cifs share ```sh -kubectl create secret generic cifscreds --from-literal username=TESTER --from-literal password=SECRET +kubectl create secret generic cifscreds --from-literal username=TESTER --from-literal password=SECRET --from-literal security=SECURITY ``` 2. create the cifs-enabled pod @@ -75,7 +75,7 @@ kubectl exec cc -- ls -l /data ### Docker building dockers - keeping them small -docker build process split into a 'builder' docker and a 'runtime' +docker build process split into a 'builder' docker and a 'runtime' docker to keep final docker image as small as possible. To build the runtime docker image, clone this project and then diff --git a/cifs.sh b/cifs.sh index 54962f9..4d22499 100755 --- a/cifs.sh +++ b/cifs.sh @@ -65,12 +65,13 @@ domount() { MOUNT_OPTIONS=$(echo "$3"|"$JQ" -r '.mountOptions // empty') USERNAME=$(echo "$3"|"$JQ" -r '.["kubernetes.io/secret/username"] // empty'|base64 -d) PASSWORD=$(echo "$3"|"$JQ" -r '.["kubernetes.io/secret/password"] // empty'|base64 -d) + SECURITY=$(echo "$3"|"$JQ" -r '.["kubernetes.io/secret/security"] // empty'|base64 -d) - ALL_OPTIONS="user=${USERNAME},pass=${PASSWORD},${READ_MODE}" + ALL_OPTIONS="user=${USERNAME},pass=${PASSWORD},sec=${SECURITY},${READ_MODE}" if [ -n "$MOUNT_OPTIONS" ]; then ALL_OPTIONS="${ALL_OPTIONS},${MOUNT_OPTIONS}" fi - + if ismounted ; then log '{"status": "Success"}' exit 0