instrumenta / kubeval

Validate your Kubernetes configuration files, supports multiple Kubernetes versions
https://kubeval.com
Other
3.16k stars 229 forks source link

kubeval doesn't seem to ignore comments #104

Closed jbialy closed 5 years ago

jbialy commented 5 years ago

I seem to be getting failures of type * Missing a kind key when a yaml contains a comment:

echo "
---
apiVersion: v1
kind: Namespace
metadata:
  name: efs-provisioner" | kubeval
The document stdin contains a valid Namespace
echo "
# Define a Namespace
---
apiVersion: v1
kind: Namespace
metadata:
  name: efs-provisioner" | kubeval
1 error occurred:

* Missing a kind key
jbialy commented 5 years ago

ah... https://github.com/garethr/kubeval/issues/78

Works fine with:

echo "
---
# Define a Namespace
apiVersion: v1
kind: Namespace
metadata:
  name: efs-provisioner" | kubeval
The document stdin contains a valid Namespace
garethr commented 5 years ago

Ah, the first example is actually two YAML documents, one of which only has the comment. Thanks.