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

Adding support for other security modes than ntlmssp #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions cifs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down