Commit Graph

38 Commits

Author SHA1 Message Date
Karl Isenberg 393ecfe7a5 feat: improve event status consistency
Event Changes:
- Renamed ActionGroupEvent.Type -> Status
- Renamed Event.Operation -> Status
- Renamed Status fields to use consistent prefixes and suffixes
- Combined Applied, Changed, Unchanged, and ServersideApplied into
  ApplySuccessful
- Added Failed status for apply, prune, and delete events
- Replaced Unspecified with Pending
- Made enum String output more consistent

Printer Changes:
- Added FormatSummary to print summary stats at the end of the
  apply/destroy, instead of after the last of each type of action
  group.
- Modified printer output to match new more consistent events.
- Updated JSON printer docs with latest schema details.

BREAKING CHANGE: Event "operations" and "type" are now "status"
BREAKING CHANGE: JSON printer schema changed to match events
BREAKING CHANGE: Event status enums renamed/refactored
2022-04-14 01:14:10 -07: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 1b68c32813 fix: Remove preview/dry-run type from events output 2022-01-07 14:55:21 -08:00
Karl Isenberg de8f67c0a5 fix: Colorize example tests
- Exit on first test failure for each file
2021-11-10 13:52:31 -08:00
Karl Isenberg 9607cb5cf1 feat: Add apply/destroy --status-events flag
- Status events disabled by default
- Status events always enabled for table output
2021-11-04 13:14:46 -07:00
Haiyan Meng 7c27474df5 Handle deletion prevention correctly
If an object with the deletion prevention annotation is removed from the
inventory, the config.k8s.io/owning-inventory annotation should be
removed from the object, and the object should be removed from the
inventory.
2021-10-13 10:15:32 -07:00
Sean Sullivan d2f83f464a Changes Print interface to add PrintStatus boolean 2021-07-01 17:36:25 -07:00
Sean Sullivan af417c6fab Refactor destroyer to use tasks 2021-06-09 15:40:32 -07:00
Mikhail Mazurskiy d41f250f19
Update dependencies to Kubernetes v1.21.1 2021-05-28 12:53:51 +10:00
Morten Torkildsen ae80e561e2 Improve the event hierarchy 2021-05-18 14:58:41 -07:00
Jingfang Liu 06cf56ef9e update printer for events 2020-12-08 11:50:41 -08:00
Sean Sullivan 0b07898142 Adds end-to-end test for pruning and namespaces 2020-11-18 13:31:41 -08:00
Sean Sullivan d0c91b1c01 Adds e2e test for init command 2020-11-18 11:59:06 -08:00
Sean Sullivan 99285377ba Implements server-side apply 2020-10-23 22:55:06 -07:00
Morten Torkildsen 507d11f31e Use Unstructured instead of Info 2020-10-20 15:38:13 -07:00
Sean Sullivan 2de4d86359 Applies inventory namespace first if necessary 2020-09-11 16:11:50 -07:00
Phani Teja Marupaka 73e5d60407 Server side preview 2020-08-04 18:01:46 -07:00
Sean Sullivan 9546486d65 Adds e2e test for basic pruning functionality 2020-08-02 23:58:41 -07:00
Sean R. Sullivan c9e7d329da Updates prune algorithm to use one inventory object 2020-07-29 18:33:49 -07:00
Jijie Wei 2da9da4e26 return inventory namespace as output 2020-07-28 12:04:05 -07:00
Morten Torkildsen 689e16e708 Add support for CRDs in the kstatus library 2020-06-04 20:43:00 -07:00
Morten Torkildsen 35c1f6c836 Fix output from lifecycle directive with the destroy command 2020-05-29 10:39:35 -07:00
Morten Torkildsen 0058932245 Reduce the number of flags for apply and improve the naming 2020-05-20 09:27:29 -07:00
Morten Torkildsen b2e6ff739d E2E-test to verify apply with CRD and CR 2020-05-17 17:30:23 -07:00
Kubernetes Prow Robot d1a269cfab
Merge pull request #160 from mortent/MoreBetterE2ETests
Improve the MultipleServices E2E tests
2020-05-04 23:43:08 -07:00
Morten Torkildsen a976ecb69e Improve the MultipleServices E2E tests 2020-05-04 20:51:02 -07:00
Morten Torkildsen bd9163b06e More checks in E2E tests 2020-05-04 16:38:11 -07:00
Morten Torkildsen c5a53217c2 Fix e2e tests 2020-03-12 21:14:19 -07:00
Phani Teja Marupaka c5b0e2f3f5 Add preview suffix 2020-03-04 11:33:11 -08:00
Phani Teja Marupaka d3ae9a01fc Detroy flag for preview 2020-02-24 11:19:08 -08:00
Morten Torkildsen db4f40125f Update the flags used to enable and configure wait for status in applier 2020-02-21 13:17:00 -08:00
Phani Teja Marupaka 48106005cf Order resources for apply 2020-02-14 09:26:49 -08:00
Phani Teja Marupaka eabc8d89b0 Remove -k -f flags destroyer and update tests 2020-02-13 14:44:39 -08:00
Phani Teja Marupaka ecd7861d6a Suggested changes 2020-02-13 11:47:54 -08:00
Phani Teja Marupaka 165f4458fe Create, modify and destroy a deployment 2020-02-12 16:00:18 -08:00
Phani Teja Marupaka 64986cc929 Destroy command 2020-02-05 16:23:11 -08:00
Phani Teja Marupaka 357bdbcd0d Suggested Changes 2020-02-05 10:15:03 -08:00
Phani Teja Marupaka ba26ffbce3 E2E tests framework for kapply 2020-02-01 11:36:33 -08:00