kpt-config-sync
kpt-config-sync copied to clipboard
Add R*Sync finalizer to delete managed resources
Add R*Sync finalizer to delete managed resources
- Add a new custom finalizer for both RootSync & RepoSync.
- Convert RootSync to use explicit custom finalizer, instead of delegating to the kubernetes owned resources garbage collector. This was done for consistency with new RepoSync finalizer. This has the tradeoff that resources will not be deleted automatically if the reconciler-manager is deleted first, but it does mean that the cleanup for RepoSync and RootSync are the same. Both RepoSync & RootSync will delete managed resources before allowing themselves to be deleted. This should both reduce flakey test failures and conform better to user expectations, especially when using RSync repos to manage other RSync objects, and using depends-on to order multiple R*Syncs.
- Update Reconciling condition before and after reconciling. Add "Initialization" and "Termination" reasons for the Reconciling condition. "Deployment" reason is still used while waiting for the Deployment to reconcile.
- Use "Replicas: 0/1" as the default Reconciling condition message when Deployment is the reason. This avoids unnecessarily updating the message when the Deployment status has not changed.
- Use Foreground deletion while cleaning up managed objects, to ensure they are fully deleted before deleting the R*Sync.
- Modify fakeClient to handle Foreground deletion propagation policy.
- Default to foreground deletion in the e2e test client wrapper. This should reduce flakey test failures.
- Add errors for invalid enums in switch cases.
- Reduce reconciler-manager watch scope with namespaced informers.
- Add ResourceVersion handling in fakeClient and tests
- Add Watch handling to fakeClient
- Use Watch to wait for objects to be deleted in the resource-manager cleanup. Fixes: b/236892981
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: karlkfi
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [karlkfi]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
added wip until rebased on https://github.com/GoogleContainerTools/kpt-config-sync/pull/25
added wip until rebased on https://github.com/GoogleContainerTools/kpt-config-sync/pull/25 One of the things to potentially do is use the draft PR
One of the things to potentially do is use the draft PR
In the cli-utils repo adding WIP causes the WIP label to be added, which blocks merging. I guess that must be a k8s bot feature tho, not a Prow feature.
/hold
In the cli-utils repo adding WIP causes the WIP label to be added, which blocks merging. I guess that must be a k8s bot feature tho, not a Prow feature.
Yes it seems like Kubernetes processes were trying to be git provider agnostic. I like using the tool if the tool has a feature optimized for something. This is a minor example of course, but gives folks a visual aid and also removes the ambiguity around is it [wip] [WIP] wip: wip// wip!!!
/unhold
/retest
@karlkfi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| kpt-config-sync-presubmit-e2e-multi-repo | 30e10bae90e4b69b89ad817efd9afe35a7990a57 | link | true | /test kpt-config-sync-presubmit-e2e-multi-repo |
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.
/hold
Extracted most of this to https://github.com/GoogleContainerTools/kpt-config-sync/pull/77
Once merged, I'll rebase this one to be just the Finalizer changes.
Replaced by https://github.com/GoogleContainerTools/kpt-config-sync/pull/498