diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-06-24 14:44:28 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-06-29 17:58:50 +0200 |
commit | b32172e20bbb701e924684ee7ef443748a4f112b (patch) | |
tree | 01a05f446b5bde43bd174591e909d136576bed50 /libpod/volume_inspect.go | |
parent | 688cc0aee3f031661b930811b2d95df1d6c601ac (diff) | |
download | podman-b32172e20bbb701e924684ee7ef443748a4f112b.tar.gz podman-b32172e20bbb701e924684ee7ef443748a4f112b.tar.bz2 podman-b32172e20bbb701e924684ee7ef443748a4f112b.zip |
container: move volume chown after spec generation
move the chown for newly created volumes after the spec generation so
the correct UID/GID are known.
Closes: https://github.com/containers/libpod/issues/5698
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/volume_inspect.go')
-rw-r--r-- | libpod/volume_inspect.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libpod/volume_inspect.go b/libpod/volume_inspect.go index 136f9da5e..2be0aeaec 100644 --- a/libpod/volume_inspect.go +++ b/libpod/volume_inspect.go @@ -65,8 +65,15 @@ func (v *Volume) Inspect() (*InspectVolumeData, error) { for k, v := range v.config.Options { data.Options[k] = v } - data.UID = v.config.UID - data.GID = v.config.GID + var err error + data.UID, err = v.UID() + if err != nil { + return nil, err + } + data.GID, err = v.GID() + if err != nil { + return nil, err + } data.Anonymous = v.config.IsAnon return data, nil |