summaryrefslogtreecommitdiff
path: root/libpod/runtime_volume_unsupported.go
diff options
context:
space:
mode:
authorDoug Rabson <dfr@rabson.org>2022-08-12 10:51:48 +0100
committerDoug Rabson <dfr@rabson.org>2022-08-17 11:45:07 +0100
commit1b88927c2cf1db7b6530748d67528b5209d93b42 (patch)
tree1007201debe0b3697a12092cd2a15f4a64a748fa /libpod/runtime_volume_unsupported.go
parentc90eec2700d2e00a4b8f1e06ca640c034af5a530 (diff)
downloadpodman-1b88927c2cf1db7b6530748d67528b5209d93b42.tar.gz
podman-1b88927c2cf1db7b6530748d67528b5209d93b42.tar.bz2
podman-1b88927c2cf1db7b6530748d67528b5209d93b42.zip
libpod: Add stubs for non-linux builds
Note: this makes info.go linux-only since it mixes linux-specific and generic code. This should be addressed in a separate refactoring PR. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
Diffstat (limited to 'libpod/runtime_volume_unsupported.go')
-rw-r--r--libpod/runtime_volume_unsupported.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/libpod/runtime_volume_unsupported.go b/libpod/runtime_volume_unsupported.go
new file mode 100644
index 000000000..c2816b817
--- /dev/null
+++ b/libpod/runtime_volume_unsupported.go
@@ -0,0 +1,42 @@
+//go:build !linux
+// +build !linux
+
+package libpod
+
+import (
+ "context"
+ "errors"
+
+ "github.com/containers/podman/v4/libpod/define"
+)
+
+// NewVolume creates a new empty volume
+func (r *Runtime) NewVolume(ctx context.Context, options ...VolumeCreateOption) (*Volume, error) {
+ if !r.valid {
+ return nil, define.ErrRuntimeStopped
+ }
+ return r.newVolume(false, options...)
+}
+
+// NewVolume creates a new empty volume
+func (r *Runtime) newVolume(noCreatePluginVolume bool, options ...VolumeCreateOption) (*Volume, error) {
+ return nil, errors.New("not implemented (*Runtime) newVolume")
+}
+
+// UpdateVolumePlugins reads all volumes from all configured volume plugins and
+// imports them into the libpod db. It also checks if existing libpod volumes
+// are removed in the plugin, in this case we try to remove it from libpod.
+// On errors we continue and try to do as much as possible. all errors are
+// returned as array in the returned struct.
+// This function has many race conditions, it is best effort but cannot guarantee
+// a perfect state since plugins can be modified from the outside at any time.
+func (r *Runtime) UpdateVolumePlugins(ctx context.Context) *define.VolumeReload {
+ return nil
+}
+
+// removeVolume removes the specified volume from state as well tears down its mountpoint and storage.
+// ignoreVolumePlugin is used to only remove the volume from the db and not the plugin,
+// this is required when the volume was already removed from the plugin, i.e. in UpdateVolumePlugins().
+func (r *Runtime) removeVolume(ctx context.Context, v *Volume, force bool, timeout *uint, ignoreVolumePlugin bool) error {
+ return errors.New("not implemented (*Runtime) removeVolume")
+}