kubeval
kubeval copied to clipboard
Multiple JSON via stdin only validates the first one
$ echo '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"test"}}\n{"kind":"Service","apiVersion":"v1","metadata":{"name":"test","namespace":"test"},"spec":{"ports":[{"name":"http","protocol":"TCP","port":80,"targetPort":80}],"selector":{"app":"test"},"type":"ClusterIP","sessionAffinity":"None"}}' | kubeval
The document stdin contains a valid Namespace
in fact, this is not just if passed via stdin. For a json file containing multiple resources, kubeval
only validates the first one
JSON doesn't support multiple documents in the same file in the same way as YAML does.