diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-24 20:41:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-24 20:41:43 +0200 |
commit | 1dfac0e776a36ae682b6600ad8edf3d118638eeb (patch) | |
tree | fc916294c16de1e28b633fb306a3fa755d90b84c /pkg | |
parent | b300b981e7b101070198e8d8c9ef5c1c97f0c394 (diff) | |
parent | e3a84b94878aaca62e55fad838a3ea4a70f0c7ce (diff) | |
download | podman-1dfac0e776a36ae682b6600ad8edf3d118638eeb.tar.gz podman-1dfac0e776a36ae682b6600ad8edf3d118638eeb.tar.bz2 podman-1dfac0e776a36ae682b6600ad8edf3d118638eeb.zip |
Merge pull request #4094 from haircommander/play-only-pod
play kube: Only support pod kind in k8s yaml
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/adapter/pods.go | 4 |
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 { |