diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-07 13:11:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-07 13:11:50 +0100 |
commit | 67dab9e360dca6c478259459157c5666d77ee817 (patch) | |
tree | fa72d2109adfa756fd4f8e3854baaeec6a23d0ac /pkg | |
parent | 8a2238440635d497dbdacceb6826c850582766ea (diff) | |
parent | 4191616cc567d553776001d640e7f2d945a4fae7 (diff) | |
download | podman-67dab9e360dca6c478259459157c5666d77ee817.tar.gz podman-67dab9e360dca6c478259459157c5666d77ee817.tar.bz2 podman-67dab9e360dca6c478259459157c5666d77ee817.zip |
Merge pull request #12726 from hikhvar/remove-superflous-pod-rename
Don't rename pod if container has the same name
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/infra/abi/play.go | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 6b3b04a0b..40c31b163 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -178,17 +178,10 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY return nil, err } - // check for name collision between pod and container + // Assert the pod has a name if podName == "" { return nil, errors.Errorf("pod does not have a name") } - for _, n := range podYAML.Spec.Containers { - if n.Name == podName { - playKubePod.Logs = append(playKubePod.Logs, - fmt.Sprintf("a container exists with the same name (%q) as the pod in your YAML file; changing pod name to %s_pod\n", podName, podName)) - podName = fmt.Sprintf("%s_pod", podName) - } - } podOpt := entities.PodCreateOptions{Infra: true, Net: &entities.NetOptions{NoHosts: options.NoHosts}} podOpt, err = kube.ToPodOpt(ctx, podName, podOpt, podYAML) |