Merge pull request #13993 from aonoa/main

Modify the pod name suffix '_pod' to '-pod'
This commit is contained in:
OpenShift Merge Robot 2022-04-25 09:37:05 -04:00 committed by GitHub
commit 9784d97bd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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(

View file

@ -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 {