-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix(validate): support returning empty resources object/slice #704
Conversation
…resources_allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments, but none of them have to block merging this as-is from my POV.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some feedback but I don't think it's anything that has to block merging this as-is. I'm a bit concerned that changing this behavior didn't necessitate test changes; we should consider adding some tests that validate the partial response on error.
I think this looks good, possibly agree with Kristin's comment above. Also wondering if you did any current validation tests and measured the outcomes against this branch v main (just to make sure partial resource return isn't flipping satisfaction on any existing validations, particularly those in UDS Core)? I feel like this is a good test case for figuring out how to really instrument a proper testbed for that sort of thing - obviously we cant test every validation, but might be nice to test a large swath - or even have an action that we support to test old v new Lula version that we could provide people to run in their own environments to ensure that their validations are still responding as expected with Lula version upgrades... |
Tested against uds-core and did not reduce counts of
I like that idea! |
BLUF
Domains are responsible for the collection of data that will be processed by a provider. This PR makes a stance that domains should:
This sets a standard where Lula always attempts to retrieve the full extent of evidence possible. When an error occurs - reviewers/auditors should want to have a full view of what worked and what did not with regards to domain resource collection.
Description
Looking to setup the changes required to test impact to our current validations on allowing domains to return a map item that contains an empty payload. Most applicable to our k8s domain but still relevant elsewhere.
Context primarily captured in the issue below - but the primary goal is that providers should be gating whether the data allows for policy adherence and not a domain. A domain should be objective in that - if there was no errors during the collection of the data - it should continue to progress.
Removed a return statement in
QueryCluster
and instead aggregate the errors into a single string - Given the ability to continue writing resources if one of theresource
items fails - this would allow for the validation to still collect evidence for later review - I believe this is a fundamental part of how Lula should operate - always being in a position to provide as much evidence as possible to enable less guessing in the event a validation or environment needs correction.Related Issue
Fixes #589
Type of change
Checklist before merging