Commit Graph

31 Commits

Author SHA1 Message Date
Karl Isenberg 119b51aabf fix: Send Failed status when erroring
- Caller should switch on Type == Failed, not Error != nil
- Error should always be non-nil for Failed and Skipped events
2022-04-19 18:22:52 -07:00
Karl Isenberg 5c095e8d66 chore: Add Inventory to TaskContext
- Add a new Inventory KRM object for storing the spec and status
  of the inventory objects in memory.
- Improve reconcile, apply, & delete status tracking in the
  TaskContext/Inventory to cover all possible statuses
- Move most of the convenience methods from the TaskContext into a
  new inventory.Manager.
- Fix a minor bug where object UID might have drifted (delete &
  recreate) between GET and DELETE.
2022-02-03 11:16:54 -08:00
Mikhail Mazurskiy 2c815d2843
feat!: applier configuration options
BREAKING CHANGE: NewApplierBuilder() is the new way to construct an Applier
BREAKING CHANGE: apply.Options renamed into apply.ApplierOptions
2022-01-29 10:04:03 +11: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 eda3554fb1 fix: skipped deletes no longer cause waiting
- Added SkippedApplies and SkippedDeletes to the TaskContext
- Modified tasks to use the new skipped tracking, replacing usage
  of failure tracking, where skipped is more accurate.
- Renamed some TaskContext methods for consistency
- Added ObjMetadataSetFromMap for use by TaskContext
- Added ObjectMetadataSet.Intersection for use by InvSetTask
- Cleaned up InvSetTask to be more readable with comments explaining
  intended behavior, including handling of skips.
- Added apply and prune tests for skipped, failure, and abandoned
2021-10-29 10:28:06 -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
Karl Isenberg 853f4b0d0b Add GroupName to Apply, Prune, and Delete events
- GroupName can be used to identify which ActionGroupEvent the
  Apply/Prune/Delete belongs to. This is useful for tracking progress
  during a long apply/destroy.
2021-10-05 17:14:11 -07:00
Karl Isenberg d964b0397b Merge Collector and ResourceCache
- Make ResourceCache thread-safe
- Make ResourceCache store status and messagei
- Add ResourceCache to baseRunner and TaskContext
- Make Mutator compute resource status for uncached resources
- Share cache between StatusPoller and Mutator
- Move Condition and conditionMet() to its own file
- Simplify WaitTask.checkCondition
- Simplify baseRunner.amendTimeoutError
2021-09-30 12:01:19 -07:00
Sean Sullivan 45cb7e31e0 Moves inventory policy check for apply into filter 2021-08-30 10:21:38 -07:00
Sean Sullivan 2f1335795d Moves apply failure inventory calculation into inventory task 2021-07-26 20:34:52 -07:00
Sean Sullivan 0cdf632cdc remove crd-specific code in apply tasks 2021-07-01 17:36:21 -07:00
Morten Torkildsen 136d1efeeb Better validation of resources prior to actuation 2021-07-01 17:02:57 -07:00
Sean Sullivan a3f3792743 rename function 2021-06-16 11:29:46 -07:00
Morten Torkildsen ac40271741 Make sure inventories are consistenly looked up based on either name or label 2021-03-28 17:48:21 -07:00
Sean Sullivan 185aa3d048 Better final inventory calculation during errors 2021-02-04 22:33:54 -08:00
Sean Sullivan 6db68fda8d Fix for final inventory update 2021-01-25 22:30:22 -08:00
Jingfang Liu c6a79a0764 add ids in the apply task into taskContext 2020-12-22 10:10:29 -08:00
Jingfang Liu 1563909024 improve PruneTask/ApplyTask task logic for inventory policy and add unit
test
2020-12-09 17:27:43 -08:00
Jingfang Liu 5184286403 enable InventoryPolicy in applier 2020-12-08 13:22:08 -08:00
Jingfang Liu 0ff98dc3f7 change apply to continue on error 2020-11-20 10:49:49 -08:00
Morten Torkildsen 3ac57786f6 Update the ManifestReader interface and implementations to use Unstructured 2020-10-26 12:13:44 -07: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
Morten Torkildsen a6c5f50abc Move ApplyOptions into ApplyTask 2020-10-14 17:33:49 -07:00
Morten Torkildsen 034d5c3456 Use the TaskContext for passing UIDs of applied resources to the pruner 2020-09-25 14:25:13 -07:00
Phani Teja Marupaka 73e5d60407 Server side preview 2020-08-04 18:01:46 -07:00
Sean R. Sullivan c9e7d329da Updates prune algorithm to use one inventory object 2020-07-29 18:33:49 -07:00
Morten Torkildsen ae77d32ad6 Simplify the InfoHelper and ApplyTask 2020-06-10 22:22:06 -07:00
Morten Torkildsen 639a191b22 Support preview when resource set contains both CRD and CR 2020-05-27 19:43:08 -07:00
Morten Torkildsen 0d7f2b323d Handle CRDs and CRs in the same set of resources 2020-05-12 13:20:53 -07:00
Morten Torkildsen b494b8e33b Use resource generation in status decisions 2020-04-21 20:43:41 -07:00