Commit Graph

58 Commits

Author SHA1 Message Date
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
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
Karl Isenberg 9fc0cd1995 Improve clarity of filter and mutator reasons
- Use stringer for all enums (to translate ids into names)
- Remove redundant effect from reason strings
- Use consistent pattern for variables in reason strings.
  We can't use structured json, but this is close, while still human
  readable.
- Remove copyright on generated files
2021-09-24 18:41:14 -07:00
Karl Isenberg 02c0fb7229 Add apply-time-mutation feature
- Detect `config.kubernetes.io/apply-time-mutation` annotation
- Parse annotation string value as YAML
- Treat source resource as a dependency
- Before applying, apply specified substitutions
- Each mutation may include one or more substitution
- Substitutions may optionally replace a token in the existing
  string value, or replace the whole value (e.g. non-strings)
- Source and target fields are specified with JSONPath expressions
- Using github.com/spyzhov/ajson because it supports mutation, and
  not just retrieval
- ApplyTimeMutator uses an in-memory ResourceCache to reduce GETs
2021-09-21 11:00:37 -07:00
Sean Sullivan 45cb7e31e0 Moves inventory policy check for apply into filter 2021-08-30 10:21:38 -07:00
Sean Sullivan aa79285f4b Move inventory annotation addition 2021-08-17 11:09:58 -07:00
Sean Sullivan 2f1335795d Moves apply failure inventory calculation into inventory task 2021-07-26 20:34:52 -07:00
Morten Torkildsen dacbf97143 Avoid dryRun as state in inventory client 2021-07-14 17:34:18 -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 8e308625e1 Inventory not found is not error during delete 2021-06-29 15:51:08 -07:00
Sean Sullivan afa0ba9c46 Log statement at start of tasks 2021-06-25 11:41:39 -07:00
Mikhail Mazurskiy 4eb7dc1f6f
Remove Initialize() on Destroyer and PruneOptions 2021-06-18 14:58:49 +10:00
Sean Sullivan a3f3792743 rename function 2021-06-16 11:29:46 -07:00
Sean Sullivan 4432f51ac3 Refactor prune/delete using ValidationFilter interface 2021-06-16 11:29:37 -07:00
Sean Sullivan af417c6fab Refactor destroyer to use tasks 2021-06-09 15:40:32 -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
Morten Torkildsen ae80e561e2 Improve the event hierarchy 2021-05-18 14:58:41 -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
Jingfang Liu ec07a4fc60 Handle APIService speically when ServerSide apply is enabled 2021-02-16 14:34:26 -08: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
Kubernetes Prow Robot 9854efe610
Merge pull request #297 from Liujingfang1/master
ingore the failed resources in wait task
2021-01-06 14:23:45 -08:00
Jingfang Liu c6a79a0764 add ids in the apply task into taskContext 2020-12-22 10:10:29 -08:00
Jingfang Liu a6bb8c2150 ingore the failed resources in wait task 2020-12-15 09:28:11 -08:00
Kubernetes Prow Robot d3e1ad2460
Merge pull request #293 from Liujingfang1/master
update printer for events
2020-12-10 11:38:14 -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 73e29daabb add different error types for empty or unmatched inventory annotation 2020-12-08 17:25:24 -08:00
Jingfang Liu 5184286403 enable InventoryPolicy in applier 2020-12-08 13:22:08 -08:00
Jingfang Liu 06cf56ef9e update printer for events 2020-12-08 11:50:41 -08:00
Jingfang Liu e808334c97 address comments 2020-11-20 18:21:54 -08:00
Jingfang Liu 0ff98dc3f7 change apply to continue on error 2020-11-20 10:49:49 -08:00
Jingfang Liu 5d8fb759a0 update events to include indentifier and error 2020-11-17 10:07:50 -08:00
Jingfang Liu 7915dc5de7 change the apply API to InventoryInfo 2020-11-11 15:07:46 -08:00
Jingfang Liu d75850b538 update kubectl to 1.18.10 2020-11-11 10:01:17 -08:00
Jingfang Liu 4983152e59 split inventory and resources in the apply interface 2020-11-04 15:00:52 -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 321f0a0101 Change PruneOptions and Destroyer to use Unstructured instead of Info 2020-10-22 21:33:23 -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