Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop validating output of closed channel in Validate #265

Merged

Conversation

Michael0x2a
Copy link
Contributor

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.

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
Copy link
Owner

yannh commented May 9, 2024

Yes, seems correct! Thanks a lot :)

@yannh yannh merged commit 20805f6 into yannh:master May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants