Commit Graph

1050 Commits

Author SHA1 Message Date
Morten Torkildsen 5240fc4cdb Use builder for creating the destroyer 2022-08-03 12:19:19 +00: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
Kubernetes Prow Robot 2d682225d8
Merge pull request #577 from mengqiy/depbump
chore: update k8s libs to 1.24
2022-05-12 16:07:47 -07:00
Karl Isenberg 4831b66130
Merge pull request #572 from karlkfi/karl-status-watcher
feat: replace StatusPoller w/ StatusWatcher
2022-05-12 15:47:05 -07:00
Mengqi Yu ddc352f366 bump to k8s 1.24 2022-05-11 18:07:45 -07:00
Karl Isenberg c46949360e feat: replace StatusPoller w/ StatusWatcher
- Add DefaultStatusWatcher that wraps DynamicClient and manages
  informers for a set of resource objects.
  - Supports two modes: root-scoped & namespace-scoped.
  - Root-scoped mode uses root-scoped informers to efficiency and
    performance.
  - Namespace-scoped mode uses namespace-scoped informers to
    minimize the permissions needed to run and the size of the
    in-memory object cache.
  - Automatic mode selects which mode to use based on whether the
    objects being watched are in one or multiple namespaces.
    This is the default mode, optimizing for performance.
  - If CRDs are being watched, the creation/deletion of CRDs can
    cause informers for those custom resources to be created/deleted.
  - In namespace-scope mode, if namespaces are being watched, the
    creation/deletion of namespaces can also trigger informers to
    be created/deleted.
  - All creates/updates/deletes to CRDs also cause RESTMapper reset.
  - Allow pods to be unschedulable for 15s before reporting the
    status as Failed. Any update resets the timer.
- Add BlindStatusWatcher for testing and disabling for dry-run.
- Add DynamicClusterReader that wraps DynamicClient.
  This is now used to look up generated resources
  (ex: Deployment > ReplicaSets > Pods).
- Add DefaultStatusReader which uses a DelegatingStatusReader to
  wrap a list of conventional and specific StatusReaders.
  This should make it easier to extend the list of StatusReaders.
- Move some pending WaitEvents to be optional in tests, now that
  StatusWatcher can resolve their status before the WaitTask starts.
- Add a new Thousand Deployments stress test (10x kind nodes)
- Add some new logs for easier debugging
- Add internal SyncEvent so that apply/delete tasks don't start
  until the StatusWatcher has finished initial synchronization.
  This helps avoid missing events from actions that happen while
  synchronization is incomplete.
- Filter optional pending WaitEvents when testing.

BREAKING CHANGE: Replace StatusPoller w/ StatusWatcher
BREAKING CHANGE: Remove PollInterval (obsolete with watcher)
2022-05-10 10:40:05 -07:00
Kubernetes Prow Robot 02d2092d8c
Merge pull request #581 from karlkfi/karl-event-order
fix: Sort reconcile events to fix flakey test
2022-05-03 14:53:11 -07:00
Kubernetes Prow Robot 59160ba204
Merge pull request #584 from karlkfi/karl-throttle-check
feat: Use server-side throttling, if enabled
2022-04-27 10:18:11 -07:00
Karl Isenberg 534438cb62 feat: Use server-side throttling, if enabled 2022-04-27 09:58:48 -07:00
Karl Isenberg 59a8300851 fix: Sort reconcile events to fix flakey test 2022-04-25 13:57:35 -07:00
Kubernetes Prow Robot 2ae0f05b40
Merge pull request #582 from karlkfi/karl-fix-flaky-applier-test
fix: Avoid race condition in applier test
2022-04-22 14:39:36 -07:00
Kubernetes Prow Robot 1fead05e8c
Merge pull request #583 from karlkfi/karl-ginkgo-v2
chore: Upgrade to Ginkgo v2
2022-04-22 10:56:12 -07:00
Karl Isenberg db1ae2bbd1 fix: Avoid race condition in applier test 2022-04-22 10:14:48 -07:00
Karl Isenberg f9563d9e37 chore: Upgrade to Ginkgo v2 2022-04-21 18:50:30 -07:00
Kubernetes Prow Robot 1d43cea19f
Merge pull request #576 from karlkfi/karl-throttling
chore: Disable client-side throttling for tests
2022-04-21 13:58:12 -07:00
Kubernetes Prow Robot 3657f0c72d
Merge pull request #580 from karlkfi/karl-phony
chore: Add PHONY to Makefile targets
2022-04-21 13:38:12 -07:00
Karl Isenberg 4a1dce44bc chore: Add PHONY to Makefile targets
- Update dependency binaries to latest versions
2022-04-20 17:55:24 -07:00
Kubernetes Prow Robot 2bfa520569
Merge pull request #579 from karlkfi/karl-error-status
fix: Send Failed status when erroring
2022-04-20 09:37:42 -07:00
Kubernetes Prow Robot bd37c6facc
Merge pull request #578 from karlkfi/karl-coe-error
chore: Test for more specific errors
2022-04-20 09:13:42 -07:00
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 4c53ada4bc chore: Test for more specific errors 2022-04-19 18:08:24 -07:00
Kubernetes Prow Robot 825458e8db
Merge pull request #575 from karlkfi/karl-event-logs
chore: Log events at -v=3 for e2e tests
2022-04-15 17:09:10 -07:00
Karl Isenberg 5fb2a68abb chore: Disable client-side throttling for tests 2022-04-15 16:36:22 -07:00
Kubernetes Prow Robot d6e0b72676
Merge pull request #574 from karlkfi/karl-event-sorting
chore: Fix event sorting for testing
2022-04-15 16:29:10 -07:00
Karl Isenberg 0cb52c61ce chore: Log events at -v=3 for e2e tests
- Events are critical to understanding progress and debugging issues
  in e2e tests.
- Change events to log at level 3 instead of just level 5.
- Change the events string format to reduce verbosity.
- Hide the "Error" in the event string when there's no error.
  This reduces unnecessary highlighting of lines in Prow test logs.
2022-04-15 16:03:18 -07:00
Karl Isenberg f124e7bb7f chore: Fix event sorting for testing
Previous sorting method was not stable, and only worked coincidentally
for the two use cases that were using it. This new method works on
more event types and only sorts contiguous events. This should make
the sort usable when we add parallel apply and watch instead of poll.
2022-04-15 15:52:11 -07:00
Kubernetes Prow Robot 5d06234969
Merge pull request #570 from karlkfi/karl-operations
feat: improve event status consistency
2022-04-14 09:28:47 -07:00
Kubernetes Prow Robot 3fa1e9e7e9
Merge pull request #573 from karlkfi/karl-e2e-names
chore: Add make target for e2e test focus
2022-04-14 09:06:47 -07:00
Karl Isenberg 393ecfe7a5 feat: improve event status consistency
Event Changes:
- Renamed ActionGroupEvent.Type -> Status
- Renamed Event.Operation -> Status
- Renamed Status fields to use consistent prefixes and suffixes
- Combined Applied, Changed, Unchanged, and ServersideApplied into
  ApplySuccessful
- Added Failed status for apply, prune, and delete events
- Replaced Unspecified with Pending
- Made enum String output more consistent

Printer Changes:
- Added FormatSummary to print summary stats at the end of the
  apply/destroy, instead of after the last of each type of action
  group.
- Modified printer output to match new more consistent events.
- Updated JSON printer docs with latest schema details.

BREAKING CHANGE: Event "operations" and "type" are now "status"
BREAKING CHANGE: JSON printer schema changed to match events
BREAKING CHANGE: Event status enums renamed/refactored
2022-04-14 01:14:10 -07:00
Karl Isenberg 80e2c16dde chore: Add make target for e2e test focus
- Ex: make test-e2e-focus FOCUS=ApplyDestroy
- Rename e2e tests to be easier to copy/paste/focus without spaces.
- Reduce stress test verbosity to reduce log spam.
- Wait for kind controllers to be ready before running tests.
2022-04-14 01:07:28 -07:00
Kubernetes Prow Robot 8aaf73964a
Merge pull request #553 from karlkfi/karl-example-summary
chore: Add example test summary
2022-04-07 11:29:58 -07:00
Karl Isenberg 2a111beb8f chore: Add example test summary
- Install column when running example tests in prow
2022-04-05 16:24:02 -07:00
Kubernetes Prow Robot 89be53da95
Merge pull request #571 from karlkfi/karl-cross-namespace-deps
chore: add test for cross namespace depends-on
2022-03-31 13:51:05 -07:00
Karl Isenberg aeff41d692 chore: add test for cross namespace depends-on 2022-03-31 11:03:19 -07:00
Kubernetes Prow Robot 42d34da893
Merge pull request #562 from karlkfi/karl-filter-errors
feat: expose skip reason as error
2022-03-28 17:15:11 -07:00