diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-25 09:37:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 09:37:05 -0400 |
commit | 9784d97bd6cef590de781575992f7a685ab1c2c2 (patch) | |
tree | a7338e1a849b17219a4253d4e58f947e9fcfa8cc | |
parent | a9f8fb9cea7763e45e2e848a62df345d79893ef0 (diff) | |
parent | 94d043be8ce99ba13c13ea3c47bec82f94f35cf5 (diff) | |
download | podman-9784d97bd6cef590de781575992f7a685ab1c2c2.tar.gz podman-9784d97bd6cef590de781575992f7a685ab1c2c2.tar.bz2 podman-9784d97bd6cef590de781575992f7a685ab1c2c2.zip |
Merge pull request #13993 from aonoa/main
Modify the pod name suffix '_pod' to '-pod'
-rw-r--r-- | libpod/kube.go | 4 | ||||
-rw-r--r-- | test/e2e/generate_kube_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libpod/kube.go b/libpod/kube.go index 5e5260dd5..eb62643fe 100644 --- a/libpod/kube.go +++ b/libpod/kube.go @@ -525,9 +525,9 @@ func simplePodWithV1Containers(ctx context.Context, ctrs []*Container) (*v1.Pod, } podName := strings.ReplaceAll(ctrs[0].Name(), "_", "") // Check if the pod name and container name will end up conflicting - // Append _pod if so + // Append -pod if so if util.StringInSlice(podName, ctrNames) { - podName = podName + "_pod" + podName = podName + "-pod" } return newPodObject( diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index 44c906eed..9c99c3d93 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -71,7 +71,7 @@ var _ = Describe("Podman generate kube", func() { Expect(pod.Spec.DNSConfig).To(BeNil()) Expect(pod.Spec.Containers[0].WorkingDir).To(Equal("")) Expect(pod.Spec.Containers[0].Env).To(BeNil()) - Expect(pod.Name).To(Equal("top_pod")) + Expect(pod.Name).To(Equal("top-pod")) numContainers := 0 for range pod.Spec.Containers { |