Commit Graph

6 Commits

Author SHA1 Message Date
Stefan Prodan f812f045c6
Set module name to `github.com/fluxcd/cli-utils`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-11-20 08:45:35 +02:00
Karl Isenberg 7aee3cc6b4 feat: error on skip
- Rewrite actuation filters to return an error with the reason for
  skipping.
- Add explicit error types for most skip errors, to make it easier to catch
  and handle them.
- Add Is method to explicit error types to allow use of errors.Is for
  recursive unwrapped matching.
- Rename InventoryPolicyFilter to InventoryPolicyPruneFilter for
  consistency with InventoryPolicyApplyFilter
- Update deletion prevention inventory-id removal to use errors.As instead
  of matching the filter name.
- Convert error structs to use pointers to allow nil errors and avoid
  copying contents.
- Update printers to handle skip errors

BREAKING CHANGE: Skipped actuation events now include an error.
BREAKING CHANGE: DeleteEvent.Reason replaced with an error.
BREAKING CHANGE: Unused InventoryNamespaceInSet error removed.
BREAKING CHANGE: InventoryOverlapError replaced with PolicyPreventedActuationError.
BREAKING CHANGE: NeedAdoptionError replaced with PolicyPreventedActuationError.
BREAKING CHANGE: NoInventoryObjError & MultipleInventoryObjError now use pointers.
2022-03-16 17:40:28 -07:00
Morten Torkildsen 602301ecfa Remove unused TimeoutError code 2021-12-07 18:49:34 +01:00
Karl Isenberg d83ce93efd Add ObjMetadataSet to encapsulate set functions
- Refactor usages of []ObjMetadata to use ObjMetadataSet
- Move Union, Diff, Contains, Hash, Remove, and Equal into
  ObjMetadataSet
- Add ToStringMap and FromStringMap for inventory serialization
2021-10-06 14:25:12 -07:00
Morten Torkildsen 63a5164ec6 Avoid panic if error is of unknown type 2020-08-21 14:51:14 -07:00
Morten Torkildsen 9135af4218 Improve error handling 2020-08-16 20:10:17 -07:00