hpe-storage / python-hpedockerplugin

HPE Native Docker Plugin
Apache License 2.0
36 stars 64 forks source link

Feature: File Persona fsMode, fsOwner implementation #602

Closed nilangekarss closed 5 years ago

nilangekarss commented 5 years ago

This commit will change the directory permission and can give access to particular user and a group for a directory.

Suppose if an administrator wants to give access to share acl_fshare1 to user with uid 1000 and group with group id 1000 also, permission of directory should be set to 754 then these are the steps he/she needs to follow:

  1. Create local user and local group associated with File Persona on 3PAR.
  2. Create share with 3PAR with docker volume create command docker volume create -d hpe --name acl_fshare1 -o filePersona -o fpg= -o fsOwner="1000:1000" -o fsMode="0754" Here 0 before the mode bits is mandatory.
  3. docker run -it -v acl_share1:/data1 --user 1000:1000 --rm busybox /bin/sh

Verification: After the mount user can see the id and permissions associated with data1 directory and permissions for this data1 directory by executing 'id' and 'ls -ltr'

also on 3PAR same can be checked with below command:

showfshare nfs -dirperm -fstore -vfs

nilangekarss commented 5 years ago

@imran-ansari @wdurairaj Please review the changes

wdurairaj commented 5 years ago

help text needs update for the -o fsMode -o fsOwner specifically for docker volume create -d hpe -o help=backends -o filePersona

nilangekarss commented 5 years ago

@wdurairaj addressed the review comments.

nilangekarss commented 5 years ago

I have commented on the review comments. Said documentation and good to have changes will be taken in next PR. Merging this change so that testers can take this build for testing.