Commit Graph

973 Commits

Author SHA1 Message Date
Kubernetes Prow Robot 6f5ee6f2ef
Merge pull request #456 from karlkfi/karl-fix-skips
fix: skipped deletes no longer cause waiting
2021-10-29 11:41:10 -07: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
Sean Sullivan 0ac281cdd4 Removes inventory from manifestloader 2021-10-29 08:55:31 -07:00
Kubernetes Prow Robot 84a79b880f
Merge pull request #453 from seans3/ignore-lint-error
Ignore receiver name lint error
2021-10-28 16:14:50 -07:00
Sean Sullivan 7fde7fba3b Ignore receiver name lint error 2021-10-28 11:20:58 -07:00
Kubernetes Prow Robot 89b6f0b5b1
Merge pull request #445 from karlkfi/karl-pruner
Clean up prune package
2021-10-20 17:04:09 -07:00
Karl Isenberg a5030ffd18 Clean up prune package
- Rename PruneOptions to Pruner (it does the work itself)
- Rename variables and internal methods for clarity/consistency
- Extract deleteObject method to improve readability
- Rename GetObject to getObject (only used internally and by test)
- Modify log messages for readability
- Add log support for prune tests
- Make log messages more consistent
2021-10-20 16:20:00 -07:00
Kubernetes Prow Robot d62b5c6200
Merge pull request #435 from mortent/UpdateVersionOfK8sLibsAndKyaml
Update to latest version of kyaml and k8s libs
2021-10-19 23:49:57 -07:00
Morten Torkildsen 73dca2b0dc Update to latest version of kyaml and k8s libs 2021-10-19 17:41:57 -07:00
Kubernetes Prow Robot d97a96b4a2
Merge pull request #439 from karlkfi/karl-cmd-timeout
Add timeout option & error on timeout/cancel
2021-10-19 11:40:24 -07:00
Karl Isenberg ee6c5a7fe4 Return error & send error event on cancel/timeout 2021-10-19 11:07:14 -07:00
Karl Isenberg 066fd77de9 Add timeout flag to apply, destroy, & status cmds 2021-10-15 17:42:05 -07:00
Mikhail Mazurskiy 7e47e6bd0e
Check exact version when determining scope 2021-10-15 12:36:25 +11:00
Mikhail Mazurskiy 9f6552d595
Check versions a CRD defines 2021-10-15 12:36:23 +11:00
Kubernetes Prow Robot 16eff57a75
Merge pull request #427 from ash2k/ash2k/drop-apiextensions-dep
Drop k8s.io/apiextensions-apiserver dependency
2021-10-14 11:21:36 -07:00
Kubernetes Prow Robot b76a0bc4ca
Merge pull request #431 from ash2k/ash2k/remove-unused-task
Remove unused ResetRESTMapperTask task
2021-10-14 09:27:27 -07:00
Kubernetes Prow Robot a299abd292
Merge pull request #423 from karlkfi/karl-global-timeout
Add global destroyer timeouts
2021-10-14 09:27:21 -07:00
Kubernetes Prow Robot 02d8b21213
Merge pull request #424 from haiyanmeng/delete-prevention
Handle deletion prevention correctly
2021-10-13 18:39:28 -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
Karl Isenberg 31679a650f Add global destroyer timeout
- Destroyer context added, with cancel test.
- Fix Applier cancel test not using specified timeouts.
- Added a few logs to help with debugging test failures
2021-10-12 17:41:57 -07:00
Kubernetes Prow Robot 8b12ecd594
Merge pull request #425 from mortent/UpdateOwners
Update owners file to only include active contributors
2021-10-12 12:38:34 -07:00
Kubernetes Prow Robot c4e5b01aa1
Merge pull request #429 from karlkfi/karl-applier-tests
Applier unit test cleanup
2021-10-12 11:54:33 -07:00
Karl Isenberg 714a3b27d4 Applier unit test cleanup
- Add test for applier.Run context cancel/timeout
- Add AssertEqual & AssertNotEqual to wrap testutil.Equal matcher
- Move common test utils to common_test.go
- Use yaml artifacts, instead of Unstructured
- Use apply.Options as test input
- Use UnstructuredSet as test input
- Extract Applier construction with fake inputs to newTestApplier
- Extract nil inventory to its own test to simplify test inputs
  to TestReadAndPrepareObjects
2021-10-12 11:33:21 -07:00
Mikhail Mazurskiy ace8272244
Remove unused ResetRESTMapperTask task 2021-10-12 19:43:52 +11:00
Mikhail Mazurskiy 7333873c91
Drop k8s.io/apiextensions-apiserver dependency 2021-10-11 21:27:48 +11:00
Kubernetes Prow Robot a1b40b59d5
Merge pull request #422 from haiyanmeng/skip
Skip InventoryPolicyApplyFilter for the `AdoptAll` inventory policy to improve the performance
2021-10-08 14:38:24 -07:00
Kubernetes Prow Robot 9cae550146
Merge pull request #426 from karlkfi/karl-unstructured-set
Add UnstructuredSet to encapsulate set functions
2021-10-08 14:18:24 -07: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
Kubernetes Prow Robot 050ae461c8
Merge pull request #420 from ash2k/ash2/cleanups
Minor cleanups
2021-10-08 06:16:58 -07:00
Kubernetes Prow Robot 223d4d51b4
Merge pull request #419 from karlkfi/karl-sets
Add ObjMetadataSet to encapsulate set functions
2021-10-07 12:17:33 -07:00
Haiyan Meng 97b02cd107 Skip InventoryPolicyApplyFilter for the `AdoptAll` inventory policy to
improve the performance

Running InventoryPolicyApplyFilter involves getting every object in the
current inventory from the live cluster, which can be expensive if the
inventory includes lots of objects.

If the inventory policy is `AdoptAll`, the current inventory can take
ownership of any objects. Therefore, it is not necessary to run
InventoryPolicyApplyFilter.
2021-10-07 10:02:30 -07:00
Mikhail Mazurskiy 7ee6ca6082
Optimize allocations a bit
No need to allocate an empty slice, nil is fine in this case. Map of empty structs is good enough and uses a bit less memory.
2021-10-07 14:38:48 +11:00
Mikhail Mazurskiy a33618ceea
Don't embed mutex
Embedding it exposes the methods, which breaks encapsulation
2021-10-07 14:37:00 +11:00
Kubernetes Prow Robot 231f3f4a69
Merge pull request #417 from haiyanmeng/rest
Skip pruning an object whose Group/Kind is not found
2021-10-06 16:04:41 -07:00
Haiyan Meng f0e71ba543 Skip pruning an object whose Group/Kind is not found 2021-10-06 14:44:21 -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 854d4fc26b Update owners file to only include active contributors 2021-10-06 11:42:46 -07:00
Kubernetes Prow Robot 1f62349d34
Merge pull request #418 from karlkfi/karl-err-event2
Add ExpErrorEvent for better e2e test failures
2021-10-06 11:24:32 -07:00
Karl Isenberg 8b1ad5067c Add ExpErrorEvent for better e2e test failures 2021-10-06 08:56:30 -07:00
Kubernetes Prow Robot 2a6b353b46
Merge pull request #416 from karlkfi/karl-fix-flaky
Fix flaky continue on error test
2021-10-05 17:46:33 -07:00
Karl Isenberg 50fb925f41 Fix flaky continue on error test
- Add GroupedEventsByID to impliment a custom sort algorithm fo use by
  tests, to simplify the comparison of otherwise unsorted
  apply/prune/delete events in an action group.
2021-10-05 17:17:19 -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
Kubernetes Prow Robot d50496a12b
Merge pull request #413 from karlkfi/karl-collector
Merge Collector and ResourceCache
2021-09-30 16:53:22 -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
Kubernetes Prow Robot 6214d1975c
Merge pull request #414 from karlkfi/karl-run-collect
Use runCollect in e2e tests more consistently
2021-09-30 10:04:07 -07:00
Karl Isenberg a2964373c8 Use runCollect in e2e tests more consistently 2021-09-29 16:02:04 -07:00
Kubernetes Prow Robot 3544d7d96e
Merge pull request #411 from seans3/fix-prune-wait-timeout
Fixes prune timeout value
2021-09-29 15:16:44 -07:00
Sean Sullivan bbd7cf104b Fixes prune timeout value 2021-09-27 15:22:27 -07:00
Kubernetes Prow Robot 73a24dc859
Merge pull request #408 from karlkfi/karl-test-fixes
e2e test cleanup
2021-09-27 12:13:45 -07:00
Kubernetes Prow Robot 8dad92fa3d
Merge pull request #410 from karlkfi/karl-filter-reasons
Improve clarity of filter and mutator reasons
2021-09-26 20:36:22 -07:00