summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hunt <pehunt@redhat.com>2019-09-24 09:54:53 -0400
committerPeter Hunt <pehunt@redhat.com>2019-09-24 09:54:55 -0400
commite3a84b94878aaca62e55fad838a3ea4a70f0c7ce (patch)
tree16a6ffdf04e49bb629eb9c67476aafc8569de20c
parent83b2348313c52cc3e20d72285a9d81d3d72c2d5d (diff)
downloadpodman-e3a84b94878aaca62e55fad838a3ea4a70f0c7ce.tar.gz
podman-e3a84b94878aaca62e55fad838a3ea4a70f0c7ce.tar.bz2
podman-e3a84b94878aaca62e55fad838a3ea4a70f0c7ce.zip
play kube: Only support pod kind in k8s yaml
Since we only really support playing pods, and no other kubernetes types Signed-off-by: Peter Hunt <pehunt@redhat.com>
-rw-r--r--pkg/adapter/pods.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/adapter/pods.go b/pkg/adapter/pods.go
index 70293a2c5..2905d5466 100644
--- a/pkg/adapter/pods.go
+++ b/pkg/adapter/pods.go
@@ -467,6 +467,10 @@ func (r *LocalRuntime) PlayKubeYAML(ctx context.Context, c *cliconfig.KubePlayVa
return nil, errors.Wrapf(err, "unable to read %s as YAML", yamlFile)
}
+ if podYAML.Kind != "Pod" {
+ return nil, errors.Errorf("Invalid YAML kind: %s. Pod is the only supported Kubernetes YAML kind", podYAML.Kind)
+ }
+
// check for name collision between pod and container
podName := podYAML.ObjectMeta.Name
for _, n := range podYAML.Spec.Containers {