diff options
author | cdoern <cdoern@redhat.com> | 2021-09-01 10:59:23 -0400 |
---|---|---|
committer | cdoern <cdoern@redhat.com> | 2021-09-14 08:32:07 -0400 |
commit | 84005330aa3d25cf6134fffc1bf20354d4a3dd85 (patch) | |
tree | aef148fafb73e36c3fed0fd7c0f2696f98a71c79 /cmd/podman/pods/create.go | |
parent | ad26684856551251100b945305f91246888ef153 (diff) | |
download | podman-84005330aa3d25cf6134fffc1bf20354d4a3dd85.tar.gz podman-84005330aa3d25cf6134fffc1bf20354d4a3dd85.tar.bz2 podman-84005330aa3d25cf6134fffc1bf20354d4a3dd85.zip |
Pod Volumes Support
added support for the --volume flag in pods using the new infra container design.
users can specify all volume options they can with regular containers
resolves #10379
Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'cmd/podman/pods/create.go')
-rw-r--r-- | cmd/podman/pods/create.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go index b3f84dcd8..7000c92c8 100644 --- a/cmd/podman/pods/create.go +++ b/cmd/podman/pods/create.go @@ -132,12 +132,7 @@ func create(cmd *cobra.Command, args []string) error { createOptions.Share = nil } else { // reassign certain optios for lbpod api, these need to be populated in spec - createOptions.InfraConmonPidFile = infraOptions.ConmonPIDFile - createOptions.InfraName = infraOptions.Name - createOptions.Hostname = infraOptions.Hostname - createOptions.Cpus = infraOptions.CPUS - createOptions.CpusetCpus = infraOptions.CPUSetCPUs - createOptions.Pid = infraOptions.PID + MapOptions() flags := cmd.Flags() infraOptions.Net, err = common.NetFlagsToNetOptions(nil, *flags, false) if err != nil { @@ -265,6 +260,10 @@ func create(cmd *cobra.Command, args []string) error { if err != nil { return err } + podSpec.Volumes = podSpec.InfraContainerSpec.Volumes + podSpec.ImageVolumes = podSpec.InfraContainerSpec.ImageVolumes + podSpec.OverlayVolumes = podSpec.InfraContainerSpec.OverlayVolumes + podSpec.Mounts = podSpec.InfraContainerSpec.Mounts } PodSpec := entities.PodSpec{PodSpecGen: *podSpec} response, err := registry.ContainerEngine().PodCreate(context.Background(), PodSpec) @@ -291,3 +290,13 @@ func replacePod(name string) error { } return removePods([]string{name}, rmOptions, false) } + +func MapOptions() { + createOptions.Cpus = infraOptions.CPUS + createOptions.CpusetCpus = infraOptions.CPUSetCPUs + createOptions.Hostname = infraOptions.Hostname + createOptions.InfraConmonPidFile = infraOptions.ConmonPIDFile + createOptions.InfraName = infraOptions.Name + createOptions.Pid = infraOptions.PID + createOptions.Volume = infraOptions.Volume +} |