Skip to content

do not delete disabled resources#2733

Open
gazarenkov wants to merge 3 commits intoredhat-developer:mainfrom
gazarenkov:do-not-delete-local-db-resources
Open

do not delete disabled resources#2733
gazarenkov wants to merge 3 commits intoredhat-developer:mainfrom
gazarenkov:do-not-delete-local-db-resources

Conversation

@gazarenkov
Copy link
Copy Markdown
Member

Description

It excludes potential deleting the resources created when certain feature is disabled (such as local db, route, monitor)

Which issue(s) does this PR fix or relate to

https://redhat.atlassian.net/browse/RHDHBUGS-2781

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

For example:

  • Create empty CR (spec.database.enableLocalDb=true by default)
  • Check DB StatefulSet created
  • Modify CR with spec.database.enableLocalDb=false and apply
  • Check DB StatefulSet is still there

@gazarenkov gazarenkov requested review from rm3l April 30, 2026 06:48
Copy link
Copy Markdown
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

Hmm.., it might be confusing to see that some resources are still there when the corresponding feature is purposely toggled from enabled to disabled. For example, I first create a Backstage CR on OCP (so with a Route created by default), then I set spec.application.route.enabled: false in the CR, and now the Route object is still present.
Maybe the Operator could add some uniquely identifiable labels on the resources it creates and manages, and only try to delete those to avoid conflict with user-created resources?
Or (thinking out loud) maybe just refuse to reconcile if there are conflicting resources that it does not manage, and thus avoid touching those?

@gazarenkov
Copy link
Copy Markdown
Member Author

Hmm.., it might be confusing to see that some resources are still there when the corresponding feature is purposely toggled from enabled to disabled. For example, I first create a Backstage CR on OCP (so with a Route created by default), then I set spec.application.route.enabled: false in the CR, and now the Route object is still present. Maybe the Operator could add some uniquely identifiable labels on the resources it creates and manages, and only try to delete those to avoid conflict with user-created resources? Or (thinking out loud) maybe just refuse to reconcile if there are conflicting resources that it does not manage, and thus avoid touching those?

Let's just document it for clarity and keep simple until we really need to make it complex.
Those resources, with specific names, are "special", operator manages it if certain feature is enabled and ignores otherwise.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

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.

2 participants