kubeval icon indicating copy to clipboard operation
kubeval copied to clipboard

Multiple JSON via stdin only validates the first one

Open tsjnsn opened this issue 5 years ago • 2 comments

$ 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

tsjnsn avatar May 31 '19 19:05 tsjnsn

in fact, this is not just if passed via stdin. For a json file containing multiple resources, kubeval only validates the first one

yashbhutwala avatar Jun 27 '19 16:06 yashbhutwala

JSON doesn't support multiple documents in the same file in the same way as YAML does.

garethr avatar Jul 13 '19 18:07 garethr