aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-26 19:58:32 +0200
committerGitHub <noreply@github.com>2019-09-26 19:58:32 +0200
commit851e3775d5d2e605bcb612054a94ac6de005f834 (patch)
treedfa72482ec44938953eb2140c39c3ad9627902c6
parentd76b21e27a7cef26865a05be02632ca76f9cf2ea (diff)
parent0cae686c7fb9af3798c8eec09aadded074d259d3 (diff)
downloadpodman-851e3775d5d2e605bcb612054a94ac6de005f834.tar.gz
podman-851e3775d5d2e605bcb612054a94ac6de005f834.tar.bz2
podman-851e3775d5d2e605bcb612054a94ac6de005f834.zip
Merge pull request #4117 from mheon/pod_no_name
Add an error for pods without a name
-rw-r--r--pkg/adapter/pods.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/adapter/pods.go b/pkg/adapter/pods.go
index 2905d5466..c8d57e2a2 100644
--- a/pkg/adapter/pods.go
+++ b/pkg/adapter/pods.go
@@ -473,6 +473,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)