mirror of
https://github.com/containers/podman
synced 2024-10-19 16:54:07 +00:00
Merge pull request #13993 from aonoa/main
Modify the pod name suffix '_pod' to '-pod'
This commit is contained in:
commit
9784d97bd6
|
@ -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(
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue