Skip to content

[WIP] Reconciler changes for PVC and snapshot in supervisor #3275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akankshapanse
Copy link
Contributor

What this PR does / why we need it:

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Testing done:
A PR must be marked "[WIP]", if no test result is provided. A WIP PR won't be reviewed, nor merged.
The requester can determine a sufficient test, e.g. build for a cosmetic change, E2E test in a predeployed setup, etc.
For new features, new tests should be done, in addition to regression tests.
If jtest is used to trigger precheckin tests, paste the result after jtest completes and remove [WIP] in the PR subject.
The review cycle will start, only after "[WIP]" is removed from the PR subject.

Special notes for your reviewer:

Release note:

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 12, 2025
@k8s-ci-robot k8s-ci-robot requested a review from gohilankit May 12, 2025 10:18
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akankshapanse

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 12, 2025
@akankshapanse akankshapanse force-pushed the prevent_svc_obj_deletion branch from 71ea182 to dfbb0ab Compare May 13, 2025 13:16
@akankshapanse akankshapanse force-pushed the prevent_svc_obj_deletion branch from dfbb0ab to 330819b Compare June 11, 2025 12:01
// This code handles cases where namespace deletion causes guest cluster and its corresponding components
// to be deleted but associated objects on supervisor remain stuck in Terminating state.
func cleanupUnusedPVCsAndSnapshotsFromGuestCluster(ctx context.Context) {
func RemoveCNSFinalizerFromPVCIfTKGClusterDeleted(ctx context.Context, k8sClient clientset.Interface,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to wait for full sync cycle to get this finalizer cleared?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not call check TKC cluster is deleted or present each time for individual PVC?
Ideally when TKC cluster is deleted, we should catch event and remove finalizers from PVCs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to wait for full sync cycle to get this finalizer cleared?

No, the reconciler should catch the PVC/Snapshot delete event and verify that guest cluster is also gone, then remove the finalizer. Full sync will add safety logic to handle the case in case event is missed or any errors encounted by reconciler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants