chuckha / kubeyaml

Validate kubernetes yaml documents against the swagger definitions
https://kubeyaml.com
101 stars 16 forks source link

Enable parsing of yaml stream #7

Open muskote60 opened 5 years ago

muskote60 commented 5 years ago

I want to use this tool together with Helm to render kubernetes resource templates and validate them. Helm does output a yaml stream seperated by --- onto stdout. The cmd version of kubeyaml seems to only scan the first yaml structure encountered. To use this tool effectively it should continue until hitting the EOF and validate each section. F.e.

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: confmap
data:
  FOO: bar
---
apiVersion: v1
kind: Service
metadata:
  name: aservice
  spec: wrong indent
---

This is a valid yaml stream. The second section does produce the expected error on the wrong indentation (unknown key) when scanned individually, this is however ignored when read because the first section is valid.