summaryrefslogtreecommitdiff
path: root/cmd/podman/pods/create.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-01 10:53:14 -0400
committerGitHub <noreply@github.com>2021-10-01 10:53:14 -0400
commit81aabc80545873a1ea6f7707a904997f1b400855 (patch)
treef918ca6a05abcf0be9e7155ca6554a42549244c8 /cmd/podman/pods/create.go
parent285c9ec69b7c48467d183d2507cbd4163b9c21c9 (diff)
parent2d86051893fc2e813f26c16d13786bb377c26d48 (diff)
downloadpodman-81aabc80545873a1ea6f7707a904997f1b400855.tar.gz
podman-81aabc80545873a1ea6f7707a904997f1b400855.tar.bz2
podman-81aabc80545873a1ea6f7707a904997f1b400855.zip
Merge pull request #11686 from cdoern/podDeviceOptions
Pod Device-Read-BPS support
Diffstat (limited to 'cmd/podman/pods/create.go')
-rw-r--r--cmd/podman/pods/create.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index ca73a8356..d5aaf09ce 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -101,6 +101,7 @@ func create(cmd *cobra.Command, args []string) error {
podIDFD *os.File
imageName string
rawImageName string
+ podName string
)
labelFile = infraOptions.LabelFile
labels = infraOptions.Label
@@ -158,10 +159,12 @@ func create(cmd *cobra.Command, args []string) error {
return err
}
}
+ podName = createOptions.Name
err = common.ContainerToPodOptions(&infraOptions, &createOptions)
if err != nil {
return err
}
+ createOptions.Name = podName
}
if cmd.Flag("pod-id-file").Changed {
@@ -264,6 +267,17 @@ func create(cmd *cobra.Command, args []string) error {
podSpec.ImageVolumes = podSpec.InfraContainerSpec.ImageVolumes
podSpec.OverlayVolumes = podSpec.InfraContainerSpec.OverlayVolumes
podSpec.Mounts = podSpec.InfraContainerSpec.Mounts
+
+ // Marshall and Unmarshal the spec in order to map similar entities
+ wrapped, err := json.Marshal(podSpec.InfraContainerSpec)
+ if err != nil {
+ return err
+ }
+ err = json.Unmarshal(wrapped, podSpec)
+ if err != nil {
+ return err
+ }
+ podSpec.Name = podName
}
PodSpec := entities.PodSpec{PodSpecGen: *podSpec}
response, err := registry.ContainerEngine().PodCreate(context.Background(), PodSpec)