Skip to content

refactor finalize package#1827

Merged
vrutkovs merged 2 commits intoVictoriaMetrics:masterfrom
endesapt:refactor-finalizer
Feb 19, 2026
Merged

refactor finalize package#1827
vrutkovs merged 2 commits intoVictoriaMetrics:masterfrom
endesapt:refactor-finalizer

Conversation

@endesapt
Copy link
Contributor

@endesapt endesapt commented Feb 19, 2026

Related to #1773

Removed reduntant SafeDelete calls where possible (except of ClusterRoles, orphaned resources)
Removed SafeDeleteForSelectorsWithFinalizer because it is repeats SafeDeleteWithFinalizer logic but with reduntant selector logic and only used in deleteSA.


Summary by cubic

Refactored finalizer logic to remove redundant delete calls, simplify ServiceAccount cleanup, and streamline the crObject interface, reducing API requests and avoiding label-mismatch issues. Fixes #1773.

  • Refactors
    • Removed SafeDeleteForSelectorsWithFinalizer and the label-matching helper.
    • Simplified crObject: dropped GetLabels and SelectorLabels; use owner references for deletion.
    • Replaced duplicate SafeDelete calls for Role/RoleBinding and HTTPRoute with removeFinalizeObjByName; split e2e update checks for stability.

Written for commit 12c31ba. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@AndrewChubatiuk
Copy link
Contributor

thanks for a PR
could also simplify crObject interface, some methods are not needed anymore?

@vrutkovs
Copy link
Collaborator

Thank you for the contribution, that looks really good!

I updated the description as it doesn't fix all the points in the linked issue, and we don't want Github to auto close it

@vrutkovs
Copy link
Collaborator

Could you sign the commit with GPG as its a requirement for contribution? If not we could push the commit ourselves

@endesapt
Copy link
Contributor Author

Thanks for filling the gaps for me. As i understand you already resigned commits with your gpg, so i don't need to do it?

@AndrewChubatiuk
Copy link
Contributor

I've already signed them, thank you!

Copy link
Collaborator

@vrutkovs vrutkovs left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@vrutkovs vrutkovs merged commit 3f2fa27 into VictoriaMetrics:master Feb 19, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor finalize package

3 participants

Comments