mirror of https://github.com/containers/podman.git
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>
This commit is contained in:
parent
83b2348313
commit
e3a84b9487
|
@ -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)
|
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
|
// check for name collision between pod and container
|
||||||
podName := podYAML.ObjectMeta.Name
|
podName := podYAML.ObjectMeta.Name
|
||||||
for _, n := range podYAML.Spec.Containers {
|
for _, n := range podYAML.Spec.Containers {
|
||||||
|
|
Loading…
Reference in New Issue