From 0cae686c7fb9af3798c8eec09aadded074d259d3 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Thu, 26 Sep 2019 09:37:41 -0400 Subject: Add an error for pods without a name Signed-off-by: Matthew Heon --- pkg/adapter/pods.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg') diff --git a/pkg/adapter/pods.go b/pkg/adapter/pods.go index 70293a2c5..2613401b8 100644 --- a/pkg/adapter/pods.go +++ b/pkg/adapter/pods.go @@ -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) -- cgit v1.2.3-54-g00ecf