From a7c5cccc16ab3becb7d8f59dd6fb79e31e14852e Mon Sep 17 00:00:00 2001 From: Ampie Barnard Date: Tue, 28 Jul 2020 19:23:32 +0200 Subject: [PATCH] ENG-932 supporting db password reset --- pom.xml | 4 ++-- ...doAppWithExternalPostgresqlDatabaseIT.java | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5d983b25..6cc18d4c 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ org.entando entando-quarkus-parent - 6.1.7 + 6.1.8 6.1.0-SNAPSHOT entando-k8s-app-controller @@ -63,7 +63,7 @@ entando-k8s ${github.organization}_${project.artifactId} - 6.1.9 + 6.1.11 6.1.5 in-process end-to-end diff --git a/src/test/java/org/entando/kubernetes/controller/app/interprocesstests/AddEntandoAppWithExternalPostgresqlDatabaseIT.java b/src/test/java/org/entando/kubernetes/controller/app/interprocesstests/AddEntandoAppWithExternalPostgresqlDatabaseIT.java index f3f301f9..722268b4 100644 --- a/src/test/java/org/entando/kubernetes/controller/app/interprocesstests/AddEntandoAppWithExternalPostgresqlDatabaseIT.java +++ b/src/test/java/org/entando/kubernetes/controller/app/interprocesstests/AddEntandoAppWithExternalPostgresqlDatabaseIT.java @@ -17,12 +17,17 @@ package org.entando.kubernetes.controller.app.interprocesstests; import io.fabric8.kubernetes.api.model.ObjectMeta; +import org.entando.kubernetes.controller.EntandoOperatorConfigProperty; import org.entando.kubernetes.controller.integrationtest.support.EntandoAppIntegrationTestHelper; +import org.entando.kubernetes.controller.integrationtest.support.KeycloakIntegrationTestHelper; import org.entando.kubernetes.controller.integrationtest.support.SampleWriter; import org.entando.kubernetes.model.DbmsVendor; import org.entando.kubernetes.model.JeeServer; import org.entando.kubernetes.model.app.EntandoApp; import org.entando.kubernetes.model.app.EntandoAppBuilder; +import org.entando.kubernetes.model.externaldatabase.EntandoDatabaseService; +import org.entando.kubernetes.model.keycloakserver.EntandoKeycloakServer; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Tags; import org.junit.jupiter.api.Test; @@ -45,8 +50,23 @@ public void create() { entandoApp.getMetadata().setNamespace(EntandoAppIntegrationTestHelper.TEST_NAMESPACE); SampleWriter.writeSample(entandoApp, "app-with-external-postgresql-db"); entandoApp.getMetadata().setName(EntandoAppIntegrationTestHelper.TEST_APP_NAME); + //When I create the entando app createAndWaitForApp(entandoApp, 0, false); + //I see all the expected deployments verifyAllExpectedResources(); + //And recreating the app still succeeds even though all the DB secrets were deleted + System.setProperty(EntandoOperatorConfigProperty.ENTANDO_K8S_OPERATOR_FORCE_DB_PASSWORD_RESET.getJvmSystemProperty(), "true"); + helper.setTextFixture(deleteAll(EntandoApp.class).fromNamespace(EntandoAppIntegrationTestHelper.TEST_NAMESPACE)); + createAndWaitForApp(entandoApp, 0, false); + verifyAllExpectedResources(); + + } + + @Override + @AfterEach + public void afterwards() { + System.getProperties().remove(EntandoOperatorConfigProperty.ENTANDO_K8S_OPERATOR_FORCE_DB_PASSWORD_RESET.getJvmSystemProperty()); + super.afterwards(); } @Override