Closed elblivion closed 7 years ago
I have some initial work on this in https://github.com/garethr/kubeval/pull/9 which seems to basically work. I want to clean it up, but if you have time and inclination I'd love any feedback.
For instance, using the fixture in this PR:
go run main.go fixtures/multi.yaml
The document fixtures/multi.yaml is not a valid Service
--> spec.ports.0.port: Invalid type. Expected: integer, given: string
The document fixtures/multi.yaml is a valid ReplicationController
The document fixtures/multi.yaml is a valid Service
The document fixtures/multi.yaml is a valid ReplicationController
The document fixtures/multi.yaml is a valid Service
The document fixtures/multi.yaml is a valid ReplicationController
exit status 1
Merged #9. Releasing an update now.
Some of our specs use a valid multi-document YAML format:
It seems like the YAML library used in kubeval doesn't support this yet: https://github.com/go-yaml/yaml#compatibility, so at the very least kubeval should warn the user that this is not supported (in testing, only the first YAML document in the file is parsed and the rest silently discarded).