-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] feat: Add ValidationPolicy & ValidationEvent
- Added ValidationPolicy: ExitEarly (default) - exit before apply/prune if any objects are invalid SkipInvalid - apply/prune valid objects & skip invalid ones ApplyAll - attempt to apply all resources - Added ValidationEvent to be sent once for every invalid object or set of objects, regardless of policy. - Added generic MultiError to wrap and unwrap a list of errors. - Simplified ValidationError to be easier to read by optionally wrapping MultiError. - Add edvalidator.NewError to construct ValidationError. - Modified graph.SortObjs to return a MultiError with all validation failures, instead of returning only the first error. This includes validation errors for depends-on and apply-time-mutation. - Modified UnstructuredsToObjMetas & UnstructuredsToObjMetasOrDie to return ObjMetadataSet to avoid needing to cast in a few places. - Moved SortObjs usage from solver to applier/destroyer. This allows the resulting errors to be treated as validation errors. - Added invalid objects to the TestContext so they can be retained in the inventory (only if already present). This primarily applies to invalid annotations and dependencies. Objects without name or kind should never be added to the inventory. - Removed invalid objects from the applySet/pruneSet after SortObjs. - Added e2e test for invalid object handling. - Removed error from ObjMetadataSet.Hash return value. Hashing will not error. This makes it easier to use Hash when sorting sets. - Move validator to object/validation package. TODO: - Add more tests - Update Printers to handle ValidationEvent BREAKING CHANGE: TaskStatusRunner.Run changed to take TaskContext
- Loading branch information
Showing
53 changed files
with
2,071 additions
and
792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.