From 2d86051893fc2e813f26c16d13786bb377c26d48 Mon Sep 17 00:00:00 2001 From: cdoern Date: Sun, 5 Sep 2021 23:22:17 -0400 Subject: Pod Device-Read-BPS support added the option for the user to specify a rate, in bytes, at which they would like to be able to read from the device being added to the pod. This is the first in a line of pod device options. WARNING: changed pod name json tag to pod_name to avoid confusion when marshaling with the containerspec's name Signed-off-by: cdoern --- cmd/podman/pods/create.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cmd/podman/pods') 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) -- cgit v1.2.3-54-g00ecf