diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-22 12:15:26 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-29 14:04:44 +0100 |
commit | f7e72bc86aff2ff986290f190309deceb7f22099 (patch) | |
tree | d6fc24ed50db3437a90944299af4a4436ca6fe7c /libpod/options.go | |
parent | 9b789359f17f22bdd2ed49087c23eebf39f338f3 (diff) | |
download | podman-f7e72bc86aff2ff986290f190309deceb7f22099.tar.gz podman-f7e72bc86aff2ff986290f190309deceb7f22099.tar.bz2 podman-f7e72bc86aff2ff986290f190309deceb7f22099.zip |
volumes: push the chown logic to runtime_volume_linux.go
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go index 84c541314..6bc145553 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1274,6 +1274,28 @@ func WithVolumeName(name string) VolumeCreateOption { } } +// WithVolumeUID sets the uid of the owner. +func WithVolumeUID(uid int) VolumeCreateOption { + return func(volume *Volume) error { + if volume.valid { + return ErrVolumeFinalized + } + volume.config.UID = uid + return nil + } +} + +// WithVolumeGID sets the gid of the owner. +func WithVolumeGID(gid int) VolumeCreateOption { + return func(volume *Volume) error { + if volume.valid { + return ErrVolumeFinalized + } + volume.config.GID = gid + return nil + } +} + // WithVolumeLabels sets the labels of the volume. func WithVolumeLabels(labels map[string]string) VolumeCreateOption { return func(volume *Volume) error { |