Modify the pod name suffix '_pod' to '-pod'

Signed-off-by: aonoa <1991849113@qq.com>
This commit is contained in:
aonoa committed 2022-04-25 15:47:24 +08:00
1 parent ba6356280a
commit 94d043be8c
2 files changed
+3 -3

No files matched your search

+2 -2
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(
+1 -1
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 {