summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2021-09-01 10:59:23 -0400
committercdoern <cdoern@redhat.com>2021-10-01 14:09:11 -0400
commit6da97c86314d8c80b912ba83db57fd26da19bfb7 (patch)
tree0e8e3de1d5eb89465b965458fb3068f59c702f34 /pkg/specgen
parente9d8524af5122314e47385299bf9ae3d0b000096 (diff)
downloadpodman-6da97c86314d8c80b912ba83db57fd26da19bfb7.tar.gz
podman-6da97c86314d8c80b912ba83db57fd26da19bfb7.tar.bz2
podman-6da97c86314d8c80b912ba83db57fd26da19bfb7.zip
Pod Volumes From Support
added support for a volumes from container. this flag just required movement of the volumes-from flag declaration out of the !IsInfra block, and minor modificaions to container_create.go Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/podspecgen.go43
1 files changed, 27 insertions, 16 deletions
diff --git a/pkg/specgen/podspecgen.go b/pkg/specgen/podspecgen.go
index ee4fbc13a..7713ea26c 100644
--- a/pkg/specgen/podspecgen.go
+++ b/pkg/specgen/podspecgen.go
@@ -72,22 +72,6 @@ type PodBasicConfig struct {
// Any containers created within the pod will inherit the pod's userns settings.
// Optional
Userns Namespace `json:"userns,omitempty"`
- // Mounts are mounts that will be added to the pod.
- // These will supersede Image Volumes and VolumesFrom (WIP) volumes where
- // there are conflicts.
- // Optional.
- Mounts []spec.Mount `json:"mounts,omitempty"`
- // Volumes are named volumes that will be added to the pod.
- // These will supersede Image Volumes and VolumesFrom (WIP) volumes where
- // there are conflicts.
- // Optional.
- Volumes []*NamedVolume `json:"volumes,omitempty"`
- // Overlay volumes are named volumes that will be added to the pod.
- // Optional.
- OverlayVolumes []*OverlayVolume `json:"overlay_volumes,omitempty"`
- // Image volumes bind-mount a container-image mount into the pod's infra container.
- // Optional.
- ImageVolumes []*ImageVolume `json:"image_volumes,omitempty"`
// Devices contains user specified Devices to be added to the Pod
Devices []string `json:"pod_devices,omitempty"`
}
@@ -174,6 +158,32 @@ type PodNetworkConfig struct {
NetworkOptions map[string][]string `json:"network_options,omitempty"`
}
+// PodStorageConfig contains all of the storage related options for the pod and its infra container.
+type PodStorageConfig struct {
+ // Mounts are mounts that will be added to the pod.
+ // These will supersede Image Volumes and VolumesFrom volumes where
+ // there are conflicts.
+ // Optional.
+ Mounts []spec.Mount `json:"mounts,omitempty"`
+ // Volumes are named volumes that will be added to the pod.
+ // These will supersede Image Volumes and VolumesFrom volumes where
+ // there are conflicts.
+ // Optional.
+ Volumes []*NamedVolume `json:"volumes,omitempty"`
+ // Overlay volumes are named volumes that will be added to the pod.
+ // Optional.
+ OverlayVolumes []*OverlayVolume `json:"overlay_volumes,omitempty"`
+ // Image volumes bind-mount a container-image mount into the pod's infra container.
+ // Optional.
+ ImageVolumes []*ImageVolume `json:"image_volumes,omitempty"`
+ // VolumesFrom is a set of containers whose volumes will be added to
+ // this pod. The name or ID of the container must be provided, and
+ // may optionally be followed by a : and then one or more
+ // comma-separated options. Valid options are 'ro', 'rw', and 'z'.
+ // Options will be used for all volumes sourced from the container.
+ VolumesFrom []string `json:"volumes_from,omitempty"`
+}
+
// PodCgroupConfig contains configuration options about a pod's cgroups.
// This will be expanded in future updates to pods.
type PodCgroupConfig struct {
@@ -191,6 +201,7 @@ type PodSpecGenerator struct {
PodNetworkConfig
PodCgroupConfig
PodResourceConfig
+ PodStorageConfig
InfraContainerSpec *SpecGenerator `json:"-"`
}