Skip to content

Commit 0f37b2e

Browse files
committed
fix: local E2E test should not delete CRD
That causes a race condition, where it marks the CRD to be deleted. But since we don't wait for cleanup of the namespace in E2E eventually the namespace is deleted by garbage collector and then the CRD is deleted. Unfortunatelly this can happen when the cluster test is already running. Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent 1633475 commit 0f37b2e

4 files changed

Lines changed: 4 additions & 0 deletions

File tree

sample-operators/metrics-processing/src/test/java/io/javaoperatorsdk/operator/sample/metrics/MetricsHandlingE2E.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class MetricsHandlingE2E {
7474
? LocallyRunOperatorExtension.builder()
7575
.withReconciler(new MetricsHandlingReconciler1())
7676
.withReconciler(new MetricsHandlingReconciler2())
77+
.withDeleteCRDs(false)
7778
.withConfigurationService(
7879
c -> c.withMetrics(MetricsHandlingSampleOperator.initOTLPMetrics(true)))
7980
.build()

sample-operators/mysql-schema/src/test/java/io/javaoperatorsdk/operator/sample/MySQLSchemaOperatorE2E.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ boolean isLocal() {
7474
.withReconciler(new MySQLSchemaReconciler()) // configuration for schema comes from
7575
// SchemaDependentResource annotation
7676
.withInfrastructure(infrastructure)
77+
.withDeleteCRDs(false)
7778
.withPortForward(MY_SQL_NS, "app", "mysql", 3306, SchemaDependentResource.LOCAL_PORT)
7879
.build()
7980
: ClusterDeployedOperatorExtension.builder()

sample-operators/tomcat-operator/src/test/java/io/javaoperatorsdk/operator/sample/TomcatOperatorE2E.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ boolean isLocal() {
6161
isLocal()
6262
? LocallyRunOperatorExtension.builder()
6363
.waitForNamespaceDeletion(false)
64+
.withDeleteCRDs(false)
6465
.withReconciler(new TomcatReconciler())
6566
.withReconciler(new WebappReconciler(client))
6667
.build()

sample-operators/webpage/src/test/java/io/javaoperatorsdk/operator/sample/WebPageOperatorE2E.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public WebPageOperatorE2E() throws FileNotFoundException {}
4242
isLocal()
4343
? LocallyRunOperatorExtension.builder()
4444
.waitForNamespaceDeletion(false)
45+
.withDeleteCRDs(false)
4546
.withReconciler(new WebPageReconciler())
4647
.build()
4748
: ClusterDeployedOperatorExtension.builder()

0 commit comments

Comments
 (0)