Commit Graph

1133 Commits

Author SHA1 Message Date
Kubernetes Prow Robot 8f4238a810
Merge pull request #614 from manfredlift/mliiv-patch-1
fix: objects flagged by CurrentUIDFilter should be removed from the inventory
2023-01-18 11:22:35 -08:00
Manfred Liiv fa95a60e37 add a link to cohabitating resources in comments 2023-01-18 12:09:52 +00:00
Manfred Liiv 1b7d9bc295 fix: objects flagged by CurrentUIDFilter should be removed from the inventory
During pruning the code is filtering objects with `CurrentUIDFilter`:
> // CurrentUIDFilter implements ValidationFilter interface to determine
// if an object should not be pruned (deleted) because it has recently
// been applied.

This must mean that the object has ended up being tracked in the inventory by more than one reference and the one that was flagged by the filter should be removed from the inventory. Otherwise, it gets stuck in the inventory indefinitely and during every invocation of prune it'll be logged as skipped.

A good example of this is `Ingress` kind existing in both groups `extensions` and `networking.k8s.io` in k8s 1.19 & 1.20. This means when you rename the apiGroup in your local yaml to the new recommended group, then the reference with the old group name gets permastuck in the inventory.
2023-01-16 17:29:19 +00:00
Manfred Liiv 982fab3ecd add failing currentUIDFilter e2e test demonstrating https://github.com/kubernetes-sigs/cli-utils/issues/613 2023-01-16 17:29:19 +00:00
Mikhail Mazurskiy a17008ea78
Fix linter warnings 2023-01-16 15:42:19 +11:00
Mikhail Mazurskiy be1f297d16
Bump dependencies 2023-01-16 12:25:01 +11:00
Kubernetes Prow Robot 11a155028c
Merge pull request #612 from manfredlift/fix-apply-failed-error
fix: pass error to applyFailed events
2023-01-13 17:06:13 -08:00
Manfred Liiv 051eca74cf fix: pass error to applyFailed events
There was a bug where an error from an apply filter wasn't propagated to the applyFailed event, which leaded to printed events without error message set on them:
> {"group":"rbac.authorization.k8s.io","kind":"RoleBinding","name":"redacted","namespace":"redacted","status":"Failed","timestamp":"2022-12-21T12:43:46Z","type":"apply"}
2022-12-21 16:10:34 +02:00
Kubernetes Prow Robot 135cc3f509
Merge pull request #606 from ash2k/ash2k/bump-deps
Update dependencies to Kubernetes v1.25.3
2022-11-03 14:32:15 -07:00
Mikhail Mazurskiy 7f1d7db44d
chore: remove file 2022-11-03 10:59:44 +11:00
Mikhail Mazurskiy 10ac02886d
chore: fix linter warnings 2022-11-03 10:59:44 +11:00
Mikhail Mazurskiy b07f05fc13
chore: update dependencies to Kubernetes v1.25.3 2022-11-03 10:59:44 +11:00
Kubernetes Prow Robot d2e7237c8b
Merge pull request #609 from rquitales/bump-go
chore: Update Go to v1.18
2022-11-02 15:33:02 -07:00
Ramon Quitales 9d2cc31682 chore: Bump go to v1.18 2022-11-02 18:58:26 +00:00
Kubernetes Prow Robot 57ba470f4b
Merge pull request #608 from rquitales/update-golangci-lint
chore: Bump golangci-lint version
2022-11-01 17:34:47 -07:00
Ramon Quitales 49981f74f3 chore: Remove deprecated linters
`varcheck`, `structcheck` and `deadcode` were deprecated in 2021. This
commit removes them. Their functionality is provided by the `unused`
linter.

See: https://github.com/golangci/golangci-lint/issues/1841
2022-11-01 22:23:17 +00:00
Ramon Quitales c494d01128 refactor: Fix linting issues found in golangci-lint v1.50.0 2022-11-01 22:21:31 +00:00
Ramon Quitales 31fa3deb2a chore: Bump golangci-lint version
This commit bumps golangci-lint to v1.5.0 as the older version has
memory issues that causes presubmits to time out.
2022-11-01 16:49:50 +00:00
Kubernetes Prow Robot c10935a7e3
Merge pull request #605 from chunglu-chou/migrate
add filtering and listing functionalities
2022-08-22 09:01:43 -07:00
Johnnie Chou ad9f752d67 add filtering and listing functionalities 2022-08-22 04:47:03 +00:00
Kubernetes Prow Robot eb8ebd7363
Merge pull request #604 from chunglu-chou/loader
add Loader interface for easier customized implementation
2022-08-18 14:12:09 -07:00
Johnnie Chou 729997bee5 add Loader interface for easier customized implementation 2022-08-18 16:30:58 +00:00
Kubernetes Prow Robot 3fe57dde29
Merge pull request #603 from chunglu-chou/kpt-json
Add json printer
2022-08-15 10:06:14 -07:00
Johnnie Chou 0dabf06e2c add json printer to support the json output format 2022-08-11 19:52:30 +00:00
Kubernetes Prow Robot 291703aeff
Merge pull request #602 from chunglu-chou/kpt-table
Support the status output in table format for other inventory types
2022-08-10 10:10:25 -07:00
Johnnie Chou 854aed09b9 add inventory_name column to include this information in table output format 2022-08-09 15:27:53 +00:00
Kubernetes Prow Robot 2cd8a3ab45
Merge pull request #601 from chunglu-chou/kpt-event
Change printing functions to support the status output for other inventory types
2022-08-09 04:36:50 -07:00
Johnnie Chou 99d35d57cd add struct PrintData to add inventory name and namespace info in printed text and modify test cases to current expected output 2022-08-08 21:57:26 +00:00
Kubernetes Prow Robot 99ba319afc
Merge pull request #600 from mortent/ExtendDelegatingStatusReader
Allow easier creation of DelegatedStatusReader with custom status readers
2022-08-04 11:13:46 -07:00
Morten Torkildsen f65372b904 Allow easier creation of DelegatedStatusReader with custom status readers 2022-08-04 10:29:24 +00:00
Kubernetes Prow Robot 89e16035a6
Merge pull request #599 from mortent/DestoryerBuilder
Use builder for creating the destroyer
2022-08-03 17:49:38 -07:00
Kubernetes Prow Robot 1669bb39a8
Merge pull request #598 from wleese/patch-1
Update README.md
2022-08-03 14:47:46 -07:00
Morten Torkildsen 5240fc4cdb Use builder for creating the destroyer 2022-08-03 12:19:19 +00:00
wvl 48d20063de
Update README.md
Fix various typoes
2022-07-29 14:46:54 +02:00
Kubernetes Prow Robot 7c25ad672c
Merge pull request #597 from gautierdelorme/fix-panic-missing-inventory
fix: do not panic when the inventory object is missing
2022-07-26 14:31:11 -07:00
Gautier Delorme 38ab8f92b6 do not panic when the inventory object is missing
Signed-off-by: Gautier Delorme <gautier.delorme@gmail.com>
2022-07-26 18:51:46 +02:00
Kubernetes Prow Robot 4dd01e9068
Merge pull request #593 from rquitales/custom-storage
fix: Always apply status when merging or replacing
2022-06-30 10:06:08 -07:00
Ramon Quitales 24aa255005 fix: Always apply status when merging or replacing
The refactor to include `Apply` and `ApplyWithPrune` interface methods
in `Storage` caused a regression where status is not alway applied. This
commit ensures that the status is always applied.
2022-06-30 00:00:29 +00:00
Kubernetes Prow Robot 60bfe71992
Merge pull request #592 from Liujingfang1/owner
update owner file
2022-06-28 17:21:12 -07:00
Jingfang Liu 41def383d7 update owner file 2022-06-28 09:55:41 -07:00
Kubernetes Prow Robot 0ba75be412
Merge pull request #590 from rquitales/custom-storage
Enable custom inventory storage cluster apply logic
2022-06-28 09:27:00 -07:00
Ramon Quitales c29e1ab60c Enable custom inventory storage logic
This commit introduces 2 new Storage interface methods to enable clients
to implement their own logic for applying inventory objects to the live
cluster.
2022-06-27 21:04:37 +00:00
Kubernetes Prow Robot 302250d9e8
Merge pull request #589 from karlkfi/karl-readme-update
chore: Update readme with features and packages
2022-06-23 18:17:19 -07:00
Karl Isenberg 596a6f552d chore: Update readme with features and packages 2022-06-09 19:08:49 -07:00
Kubernetes Prow Robot b00a8f8d45
Merge pull request #588 from karlkfi/karl-delete-notfound
fix: make deletion idempotent
2022-06-07 16:47:49 -07:00
Karl Isenberg 45607b8abb fix: make deletion idempotent
- Don't error when a delete returns NotFound.
  This means the object was deleted asynchronously by another client
  between the initial GET for task scheduling and the delete task itself.
  Log a warning, because it's possible the deletion may have violated
  dependency ordering.
- Update apply and delte task logs to only log errors if the verbosity
  is greater than -v=4. This should help reduce duplicate log messages.
2022-06-07 16:00:29 -07:00
Kubernetes Prow Robot a323326382
Merge pull request #587 from karlkfi/karl-stress-retry
chore: add stress test that validates retries
2022-06-07 15:08:26 -07:00
Karl Isenberg 9dcbe6622a chore: add stress test that validates retries
- Duplicate the 1,000 Deployment test, but use a 1m reconcile timeout in
  a retry loop.
- This verifies that the applier and destroyer are re-entrant at scale.
2022-06-07 10:57:20 -07:00
Kubernetes Prow Robot 0cb95eeda6
Merge pull request #585 from karlkfi/karl-watch-perm-error
fix: Stop StatusWatcher on Forbidden API error
2022-05-17 16:38:31 -07:00
Karl Isenberg 57bbe71b9b fix: Stop StatusWatcher on Forbidden API error
- This matches previous StatusPoller behavior which would error
  and exit if there was a 403 Forbidden error from the apiserver.
- Handle status error before synchronization with immediate exit
2022-05-17 14:24:32 -07:00