mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-09-24 08:37:55 +00:00
Add an error for pods without a name
Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
parent
83b2348313
commit
0cae686c7f
1 changed files with 3 additions and 0 deletions
|
|
@ -469,6 +469,9 @@ func (r *LocalRuntime) PlayKubeYAML(ctx context.Context, c *cliconfig.KubePlayVa
|
|||
|
||||
// check for name collision between pod and container
|
||||
podName := podYAML.ObjectMeta.Name
|
||||
if podName == "" {
|
||||
return nil, errors.Errorf("pod does not have a name")
|
||||
}
|
||||
for _, n := range podYAML.Spec.Containers {
|
||||
if n.Name == podName {
|
||||
fmt.Printf("a container exists with the same name (%s) as the pod in your YAML file; changing pod name to %s_pod\n", podName, podName)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue