diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-14 21:56:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 21:56:37 -0500 |
commit | 8ce9995951b14a0a4d7252cdd97597411fd5f980 (patch) | |
tree | b59fcfdfc29ff3979186116e23373c8d72f31169 /libpod/runtime.go | |
parent | 2b7793b6121d336a285fb7b9a7612c221cbf63d2 (diff) | |
parent | f781efd2dca4c1db54762c6edec2b915e48dd5d8 (diff) | |
download | podman-8ce9995951b14a0a4d7252cdd97597411fd5f980.tar.gz podman-8ce9995951b14a0a4d7252cdd97597411fd5f980.tar.bz2 podman-8ce9995951b14a0a4d7252cdd97597411fd5f980.zip |
Merge pull request #8604 from mheon/volume_plugin_impl
Initial implementation of volume plugins
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 1004e4fa7..34c737a67 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -17,6 +17,7 @@ import ( "github.com/containers/podman/v2/libpod/events" "github.com/containers/podman/v2/libpod/image" "github.com/containers/podman/v2/libpod/lock" + "github.com/containers/podman/v2/libpod/plugin" "github.com/containers/podman/v2/libpod/shutdown" "github.com/containers/podman/v2/pkg/cgroups" "github.com/containers/podman/v2/pkg/registries" @@ -888,3 +889,18 @@ func (r *Runtime) reloadStorageConf() error { logrus.Infof("applied new storage configuration: %v", r.storageConfig) return nil } + +// getVolumePlugin gets a specific volume plugin given its name. +func (r *Runtime) getVolumePlugin(name string) (*plugin.VolumePlugin, error) { + // There is no plugin for local. + if name == define.VolumeDriverLocal || name == "" { + return nil, nil + } + + pluginPath, ok := r.config.Engine.VolumePlugins[name] + if !ok { + return nil, errors.Wrapf(define.ErrMissingPlugin, "no volume plugin with name %s available", name) + } + + return plugin.GetVolumePlugin(name, pluginPath) +} |