Flag for opting out delete CRDs for LocallyRunOperatorExtension#3315
Open
Flag for opting out delete CRDs for LocallyRunOperatorExtension#3315
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-out flag to prevent CRD deletion when using LocallyRunOperatorExtension, and updates sample E2E tests to disable CRD cleanup for local runs.
Changes:
- Add
withDeleteCRDs(boolean)toLocallyRunOperatorExtension.Builderand wire it into CRD cleanup behavior. - Update multiple sample operator E2E tests to call
withDeleteCRDs(false)for local execution. - Make
ClusterDeployedOperatorExtensionmore tolerant when no CRD files are present under./target/classes/META-INF/fabric8/.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sample-operators/webpage/src/test/java/io/javaoperatorsdk/operator/sample/WebPageOperatorE2E.java | Disables CRD deletion for locally-run E2E execution. |
| sample-operators/tomcat-operator/src/test/java/io/javaoperatorsdk/operator/sample/TomcatOperatorE2E.java | Disables CRD deletion for locally-run E2E execution. |
| sample-operators/mysql-schema/src/test/java/io/javaoperatorsdk/operator/sample/MySQLSchemaOperatorE2E.java | Disables CRD deletion for locally-run E2E execution. |
| sample-operators/metrics-processing/src/test/java/io/javaoperatorsdk/operator/sample/metrics/MetricsHandlingE2E.java | Disables CRD deletion for locally-run E2E execution. |
| operator-framework-junit/src/main/java/io/javaoperatorsdk/operator/junit/LocallyRunOperatorExtension.java | Introduces builder override for CRD deletion behavior (currently implemented via mutable static state). |
| operator-framework-junit/src/main/java/io/javaoperatorsdk/operator/junit/ClusterDeployedOperatorExtension.java | Avoids NPE when CRD directory has no matching files; logs a warning instead. |
xstefank
approved these changes
Apr 27, 2026
Collaborator
xstefank
left a comment
There was a problem hiding this comment.
I still don't understand why it would be useful for somebody though.
Collaborator
Author
Let's say you have a test cluster that runs the operator, and have pre installled CRDs. But you want to run also integrationt tests on that cluster, you don't want to delete CRDs after tests are already run. |
89293a9 to
0e3d86a
Compare
metacosm
reviewed
Apr 27, 2026
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Attila Mészáros a_meszaros@apple.com