diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-04-22 13:43:28 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-04-22 14:24:12 -0400 |
commit | b4a4338dfe684dea1e919af1bec24a83708c1525 (patch) | |
tree | cb7b9b2b6c36065ba8610a88861468beefceaf80 /pkg/specgen/specgen.go | |
parent | 703fd505538fdae2165dad47c7a6886ac3ed891e (diff) | |
download | podman-b4a4338dfe684dea1e919af1bec24a83708c1525.tar.gz podman-b4a4338dfe684dea1e919af1bec24a83708c1525.tar.bz2 podman-b4a4338dfe684dea1e919af1bec24a83708c1525.zip |
Enable basic volumes support in Podmanv2
This enables the --volume, --mount, and --tmpfs flags in
Podmanv2. It does not enable init-related flags, image volumes,
and --volumes-from.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/specgen/specgen.go')
-rw-r--r-- | pkg/specgen/specgen.go | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go index e102a3234..37f2b3190 100644 --- a/pkg/specgen/specgen.go +++ b/pkg/specgen/specgen.go @@ -171,7 +171,7 @@ type ContainerStorageConfig struct { // These will supersede Image Volumes and VolumesFrom volumes where // there are conflicts. // Optional. - Volumes []*Volumes `json:"volumes,omitempty"` + Volumes []*NamedVolume `json:"volumes,omitempty"` // Devices are devices that will be added to the container. // Optional. Devices []spec.LinuxDevice `json:"devices,omitempty"` @@ -387,10 +387,17 @@ type SpecGenerator struct { ContainerHealthCheckConfig } -// Volumes is a temporary struct to hold input from the User -type Volumes struct { - Name string - Dest string +// NamedVolume holds information about a named volume that will be mounted into +// the container. +type NamedVolume struct { + // Name is the name of the named volume to be mounted. May be empty. + // If empty, a new named volume with a pseudorandomly generated name + // will be mounted at the given destination. + Name string + // Destination to mount the named volume within the container. Must be + // an absolute path. Path will be created if it does not exist. + Dest string + // Options are options that the named volume will be mounted with. Options []string } |