Skip to content

Commit

Permalink
Merge pull request #4094 from haircommander/play-only-pod
Browse files Browse the repository at this point in the history
play kube: Only support pod kind in k8s yaml
  • Loading branch information
openshift-merge-robot authored Sep 24, 2019
2 parents b300b98 + e3a84b9 commit 1dfac0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/adapter/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1dfac0e

Please sign in to comment.