diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-20 20:46:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 20:46:05 +0200 |
commit | dd18844bdb3a85a447b7505af465c2fa8a491efa (patch) | |
tree | 9c940779070dbf778d1a034cc6020a1ed57e00f2 /cmd/podman | |
parent | 7ccd821397d03ed545635de2a0b70a68ab4d46db (diff) | |
parent | d10bc9f045ad7bc52d03bbf9462b3f94e693ccd1 (diff) | |
download | podman-dd18844bdb3a85a447b7505af465c2fa8a491efa.tar.gz podman-dd18844bdb3a85a447b7505af465c2fa8a491efa.tar.bz2 podman-dd18844bdb3a85a447b7505af465c2fa8a491efa.zip |
Merge pull request #7388 from Luap99/new-pod
fix pod creation with "new:" syntax followup + allow hostname
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/containers/create.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go index 6eec93f98..801547033 100644 --- a/cmd/podman/containers/create.go +++ b/cmd/podman/containers/create.go @@ -297,7 +297,12 @@ func createPodIfNecessary(s *specgen.SpecGenerator, netOpts *entities.NetOptions Infra: true, Net: netOpts, CreateCommand: os.Args, + Hostname: s.ContainerBasicConfig.Hostname, } + // Unset config values we passed to the pod to prevent them being used twice for the container and pod. + s.ContainerBasicConfig.Hostname = "" + s.ContainerNetworkConfig = specgen.ContainerNetworkConfig{} + s.Pod = podName return registry.ContainerEngine().PodCreate(context.Background(), createOptions) } |