Commit Graph

14 Commits

Author SHA1 Message Date
Karl Isenberg 4e94795493 chore: refactor inventory pkg to avoid stuttering 2022-02-15 14:48:39 -08:00
Karl Isenberg 242b6aa83e fix: Don't panic when ObjMetadata is invalid
- UnstructuredToObjMetaOrDie -> UnstructuredToObjMetadata
- UnstructuredToObjMeta -> UnstructuredToObjectMetadata
- UnstructuredsToObjMetasOrDie -> UnstructuredSetToObjMetadataSet
- UnstructuredsToObjMetas -> UnstructuredSetToObjMetadataSet
- Remove CreateObjMetadata (Validator performs validation)
2022-01-07 18:50:30 -08:00
Karl Isenberg ab5a4dc294 fix: Improve task & event logging
- Log tasks at start and end
- Log events before sending
- Add String funcs for readable event logs
2021-11-09 16:43:25 -08:00
Karl Isenberg a24aaea775 feat: send WaitEvent for every resource
- WaitEvent can be Pending, Reconciled, Skipped, or Timeout.
  Skipped, Pending, and Reconciled events are sent at task start.
  Reconciled events are sent later as status updates are recieved.
  Timeout events are sent for remaining events on timeout.
- Rewrite WaitTask.Start to use context.WithTimeout and a goroutine to
  handle task completion (replacing setTimer and the token hack).
- Replaced Task.ClearTimeout with Task.Cancel.
- Replaced WaitTask.complete & checkCondition with Task.StatusUpdate.
- Replaced WaitTask.startAndComplete with a check in WaitTask.Start.
- Replaced WaitTask.amendTimeoutError with WaitTask.sendTimeoutEvents
  to send multiple timeout events, instead of one event with a list of
  TimedOutResources.
- Updated all printers to handle WaitEvent.
  Event printer now includes reconcile events.
  JSON printer now includes resourceReconciled eventType.
  Table printer not includes reconcile column.
- Added JSON printer tests for error handling.
- Updated Formatter.FormatActionGroupEvent to collect WaitStats.
- Enable status events by default for kapply with table output

BREAKING CHANGE: WaitEvents now sent for each object
2021-11-04 10:57:35 -07:00
Mikhail Mazurskiy 7333873c91
Drop k8s.io/apiextensions-apiserver dependency 2021-10-11 21:27:48 +11:00
Karl Isenberg 604c9deb8b Add UnstructuredSet to encapsulate set functions
- Refactor usages to []Unstructured to use UnstructuredSet
- Add UnstructuredSet.Equal to handle set equality comparison
- Avoid updating tests to prove reverse compatibility
  (except: Graph.SortObj, which returns a list of sets)
2021-10-08 13:45:46 -07: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 dacbf97143 Avoid dryRun as state in inventory client 2021-07-14 17:34:18 -07:00
Morten Torkildsen 136d1efeeb Better validation of resources prior to actuation 2021-07-01 17:02:57 -07:00
Sean Sullivan afa0ba9c46 Log statement at start of tasks 2021-06-25 11:41:39 -07:00
Kubernetes Prow Robot 670dee18a1
Merge pull request #362 from ash2k/ash2k/simplify-accessor
Simplify: remove unneeded meta.Accessor() usage
2021-06-02 22:21:38 -07:00
Mikhail Mazurskiy 3514065221
Simplify: remove unneeded meta.Accessor() usage 2021-05-28 15:03:09 +10:00
Mikhail Mazurskiy d41f250f19
Update dependencies to Kubernetes v1.21.1 2021-05-28 12:53:51 +10:00
Sean Sullivan 42e330d4d8 Move inventory operations into tasks 2021-05-26 17:47:00 -07:00