Skip to content

Commit

Permalink
play kube: Only support pod kind in k8s yaml
Browse files Browse the repository at this point in the history
Since we only really support playing pods, and no other kubernetes types

Signed-off-by: Peter Hunt <[email protected]>
  • Loading branch information
haircommander committed Sep 24, 2019
1 parent 83b2348 commit e3a84b9
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 e3a84b9

Please sign in to comment.