yannh / kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Apache License 2.0
2.27k stars 123 forks source link

Stop validating output of closed channel in Validate #265

Closed Michael0x2a closed 6 months ago

Michael0x2a commented 7 months ago

Currently, Validate and ValidateWithContext always returns a result with status Empty and a missing 'kind' key error as the final item in the returned slice.

This is because ValidateWithContext currently will parse the output of resourcesChan, even when the context is finished and we get back a default Resource struct.

This PR modifies the code to skip validating this case.

yannh commented 6 months ago

Yes, seems correct! Thanks a lot :)