diff options
author | zhangguanzhang <zhangguanzhang@qq.com> | 2020-12-21 11:37:12 +0800 |
---|---|---|
committer | zhangguanzhang <zhangguanzhang@qq.com> | 2020-12-23 09:13:20 +0800 |
commit | 28138dafcc391b0d03633ee9c8e23ebc229842ba (patch) | |
tree | d373363d0d597c9e937afb3b4b6865f9950b645e /pkg/domain/infra/abi | |
parent | 5c6b5ef34905f40562b518799c35be8d06694e65 (diff) | |
download | podman-28138dafcc391b0d03633ee9c8e23ebc229842ba.tar.gz podman-28138dafcc391b0d03633ee9c8e23ebc229842ba.tar.bz2 podman-28138dafcc391b0d03633ee9c8e23ebc229842ba.zip |
Fix missing options in volumes display while setting uid and gid
```
$ podman volume create testvol --opt o=uid=1001,gid=1001
$ ./bin/podman volume create testvol2 --opt o=uid=1001,gid=1001
$ podman volume inspect testvol
"Options": {},
$ podman volume inspect testvol2
"Options": {
"GID": "1001",
"UID": "1001",
"o": "uid=1001,gid=1001"
},
```
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/parse/parse.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/parse/parse.go b/pkg/domain/infra/abi/parse/parse.go index 37568ea11..6a6380e33 100644 --- a/pkg/domain/infra/abi/parse/parse.go +++ b/pkg/domain/infra/abi/parse/parse.go @@ -38,6 +38,9 @@ func VolumeOptions(opts map[string]string) ([]libpod.VolumeCreateOption, error) } logrus.Debugf("Removing uid= from options and adding WithVolumeUID for UID %d", intUID) libpodOptions = append(libpodOptions, libpod.WithVolumeUID(intUID)) + finalVal = append(finalVal, o) + // set option "UID": "$uid" + volumeOptions["UID"] = splitO[1] case "gid": if len(splitO) != 2 { return nil, errors.Wrapf(define.ErrInvalidArg, "gid option must provide a GID") @@ -48,6 +51,9 @@ func VolumeOptions(opts map[string]string) ([]libpod.VolumeCreateOption, error) } logrus.Debugf("Removing gid= from options and adding WithVolumeGID for GID %d", intGID) libpodOptions = append(libpodOptions, libpod.WithVolumeGID(intGID)) + finalVal = append(finalVal, o) + // set option "GID": "$gid" + volumeOptions["GID"] = splitO[1] default: finalVal = append(finalVal, o) } |