diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-19 13:57:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-19 13:57:15 +0200 |
commit | bd0b05f13860b62de389ec67eadd0df6b44d4f4f (patch) | |
tree | f2ceb2257d86ff0348b3c60a100b3e3e3f9033e5 /libpod/options.go | |
parent | befaa95d93481eef0d75d3babce7c6c643ecf85f (diff) | |
parent | 582a24dfed12da93a3a5e36ad269787b4ece93fc (diff) | |
download | podman-bd0b05f13860b62de389ec67eadd0df6b44d4f4f.tar.gz podman-bd0b05f13860b62de389ec67eadd0df6b44d4f4f.tar.bz2 podman-bd0b05f13860b62de389ec67eadd0df6b44d4f4f.zip |
Merge pull request #3709 from mheon/volume_inspect
Change backend code for 'volume inspect'
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libpod/options.go b/libpod/options.go index d2a67e38c..a7ddbec34 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1371,6 +1371,17 @@ func WithNamedVolumes(volumes []*ContainerNamedVolume) CtrCreateOption { } } +// WithHealthCheck adds the healthcheck to the container config +func WithHealthCheck(healthCheck *manifest.Schema2HealthConfig) CtrCreateOption { + return func(ctr *Container) error { + if ctr.valid { + return define.ErrCtrFinalized + } + ctr.config.HealthCheckConfig = healthCheck + return nil + } +} + // Volume Creation Options // WithVolumeName sets the name of the volume. @@ -1390,30 +1401,30 @@ func WithVolumeName(name string) VolumeCreateOption { } } -// WithVolumeLabels sets the labels of the volume. -func WithVolumeLabels(labels map[string]string) VolumeCreateOption { +// WithVolumeDriver sets the volume's driver. +// It is presently not implemented, but will be supported in a future Podman +// release. +func WithVolumeDriver(driver string) VolumeCreateOption { return func(volume *Volume) error { if volume.valid { return define.ErrVolumeFinalized } - volume.config.Labels = make(map[string]string) - for key, value := range labels { - volume.config.Labels[key] = value - } - - return nil + return define.ErrNotImplemented } } -// WithVolumeDriver sets the driver of the volume. -func WithVolumeDriver(driver string) VolumeCreateOption { +// WithVolumeLabels sets the labels of the volume. +func WithVolumeLabels(labels map[string]string) VolumeCreateOption { return func(volume *Volume) error { if volume.valid { return define.ErrVolumeFinalized } - volume.config.Driver = driver + volume.config.Labels = make(map[string]string) + for key, value := range labels { + volume.config.Labels[key] = value + } return nil } @@ -1700,14 +1711,3 @@ func WithInfraContainerPorts(bindings []ocicni.PortMapping) PodCreateOption { return nil } } - -// WithHealthCheck adds the healthcheck to the container config -func WithHealthCheck(healthCheck *manifest.Schema2HealthConfig) CtrCreateOption { - return func(ctr *Container) error { - if ctr.valid { - return define.ErrCtrFinalized - } - ctr.config.HealthCheckConfig = healthCheck - return nil - } -} |