Skip to content
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

Add RemoteKubernetesCluster finalizer #2272

Merged

Conversation

zimnx
Copy link
Collaborator

@zimnx zimnx commented Dec 16, 2024

Description of your changes:

Controller reconciles finalizer on RemoteKubernetesCluster, preventing from premature deletion. It waits until all ScyllaDBClusters using particular RemoteKubernetesCluster are deleted.

Which issue is resolved by this Pull Request:
Resolves #2277

@zimnx zimnx added kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Dec 16, 2024
Copy link
Contributor

@zimnx: GitHub didn't allow me to request PR reviews from the following users: zimnx.

Note that only scylladb members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Description of your changes:

Controller reconciles finalizer on RemoteKubernetesCluster, preventing from premature deletion. It waits until all ScyllaDBClusters using particular RemoteKubernetesCluster are deleted.

Which issue is resolved by this Pull Request:
Resolves #

/cc

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-sigs/prow repository.

@scylla-operator-bot scylla-operator-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2024
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zimnx

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

@scylla-operator-bot scylla-operator-bot bot 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 Dec 16, 2024
@zimnx zimnx force-pushed the remotekubernetescluster-finalizer branch from c422af5 to 846eef0 Compare December 17, 2024 13:12
@zimnx zimnx changed the title [WIP] Add RemoteKubernetesCluster protection controller Add RemoteKubernetesCluster protection controller Dec 17, 2024
@scylla-operator-bot scylla-operator-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 17, 2024
@zimnx
Copy link
Collaborator Author

zimnx commented Dec 17, 2024

Ready to review

/cc rzetelskik
/cc tnozicka

@zimnx zimnx changed the title Add RemoteKubernetesCluster protection controller Add RemoteKubernetesCluster finalizer Dec 17, 2024
@zimnx zimnx requested review from mflendrich and removed request for tnozicka January 13, 2025 12:27
Copy link
Collaborator

@mflendrich mflendrich left a comment

Choose a reason for hiding this comment

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

lgtm except for the typo

/assign rzetelskik

Resource: schema.GroupVersionResource{
Group: "scylla.scylladb.com",
Version: "v1alpha1",
Resource: "remotekuberneteclusters",
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo: missing trailing S in kubernete.

I'm worried that this isn't failing the tests. Is this gvr necessary indeed?

Furthermore - the fact that resource and kind literals are scattered across the codebase feels like a code smell. Not something to fix in this PR, but worth noting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's there to remove conflicting cluster-wide resource in case it's there and restore after the test. These resources are not created as part of CI so it just passes silently and it's expected. Good catch!

Used scyllav1alpha1.GroupVersion constants since we already have them, but left resource name since we don't have it anywhere.

Controller reconciles finalizer on RemoteKubernetesCluster, preventing from premature deletion.
It waits until all ScyllaDBClusters using particular RemoteKubernetesCluster are deleted.
@zimnx zimnx force-pushed the remotekubernetescluster-finalizer branch from 846eef0 to d74bf20 Compare January 24, 2025 12:23
@rzetelskik
Copy link
Member

/lgtm

@scylla-operator-bot scylla-operator-bot bot added the lgtm Indicates that a PR is ready to be merged. label Jan 27, 2025
@scylla-operator-bot scylla-operator-bot bot merged commit 7d72311 into scylladb:master Jan 27, 2025
13 checks passed
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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.

Add finalizer to RemoteKubernetesCluster protecting too early deletion #47
3 participants