summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-24 01:07:43 +0200
committerGitHub <noreply@github.com>2019-10-24 01:07:43 +0200
commit4b8832a9af85471bab64963bea42d8e54fad0877 (patch)
tree6b480ba95e7588de1bdff548413a001e344b195a /libpod/options.go
parent2e6c9aa4901b30653d814f4984663cf07fc5e57f (diff)
parentf60a814e4d9da87ac0dd5835b9a790a0b63f54b3 (diff)
downloadpodman-4b8832a9af85471bab64963bea42d8e54fad0877.tar.gz
podman-4b8832a9af85471bab64963bea42d8e54fad0877.tar.bz2
podman-4b8832a9af85471bab64963bea42d8e54fad0877.zip
Merge pull request #4298 from mheon/uid_gid_options
Add parsing for UID, GID in volume "o" option
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index ddc5993af..17a075d2d 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1487,6 +1487,8 @@ func WithVolumeLabels(labels map[string]string) VolumeCreateOption {
}
// WithVolumeOptions sets the options of the volume.
+// If the "local" driver has been selected, options will be validated. There are
+// currently 3 valid options for the "local" driver - o, type, and device.
func WithVolumeOptions(options map[string]string) VolumeCreateOption {
return func(volume *Volume) error {
if volume.valid {
@@ -1495,6 +1497,13 @@ func WithVolumeOptions(options map[string]string) VolumeCreateOption {
volume.config.Options = make(map[string]string)
for key, value := range options {
+ switch key {
+ case "type", "device", "o":
+ volume.config.Options[key] = value
+ default:
+ return errors.Wrapf(define.ErrInvalidArg, "unrecognized volume option %q is not supported with local driver", key)
+ }
+
volume.config.Options[key] = value
}