From 1de2d1f92be97990924dc3f39f7af1bfbfb0f6cc Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Wed, 13 Nov 2024 09:51:34 -0300 Subject: [PATCH] Remove `QUARKUS_FLYWAY_ENABLED` env from Kubernetes resources Because this is a build-time configuration property, it doesn't make sense to have it added here --- .../quarkus/flyway/deployment/FlywayProcessor.java | 3 +-- .../it/kubernetes/KubernetesWithFlywayInitBase.java | 12 ++---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java b/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java index e55818785a9af..1305b964058be 100644 --- a/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java +++ b/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java @@ -298,8 +298,7 @@ public ServiceStartBuildItem startActions(FlywayRecorder recorder, public InitTaskBuildItem configureInitTask(ApplicationInfoBuildItem app) { return InitTaskBuildItem.create() .withName(app.getName() + "-flyway-init") - .withTaskEnvVars(Map.of("QUARKUS_INIT_AND_EXIT", "true", "QUARKUS_FLYWAY_ENABLED", "true")) - .withAppEnvVars(Map.of("QUARKUS_FLYWAY_ENABLED", "false")) + .withTaskEnvVars(Map.of("QUARKUS_INIT_AND_EXIT", "true")) .withSharedEnvironment(true) .withSharedFilesystem(true); } diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithFlywayInitBase.java b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithFlywayInitBase.java index 565d098e0fa6e..099709a3b301b 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithFlywayInitBase.java +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithFlywayInitBase.java @@ -29,9 +29,7 @@ public void assertGeneratedResources(Path kubernetesDir, String name, String tas && name.equals(d.getMetadata().getName())) .map(d -> (Deployment) d).findAny(); - assertTrue(deployment.isPresent()); - assertThat(deployment).satisfies(j -> j.isPresent()); - assertThat(deployment.get()).satisfies(d -> { + assertThat(deployment).isPresent().get().satisfies(d -> { assertThat(d.getMetadata()).satisfies(m -> { assertThat(m.getName()).isEqualTo(name); }); @@ -56,9 +54,7 @@ public void assertGeneratedResources(Path kubernetesDir, String name, String tas .filter(j -> "Job".equals(j.getKind()) && jobName.equals(j.getMetadata().getName())) .map(j -> (Job) j) .findAny(); - assertTrue(job.isPresent()); - - assertThat(job.get()).satisfies(j -> { + assertThat(job).isPresent().get().satisfies(j -> { assertThat(j.getSpec()).satisfies(jobSpec -> { assertThat(jobSpec.getCompletionMode()).isEqualTo("NonIndexed"); assertThat(jobSpec.getTemplate()).satisfies(t -> { @@ -69,10 +65,6 @@ public void assertGeneratedResources(Path kubernetesDir, String name, String tas assertThat(podSpec.getRestartPolicy()).isEqualTo("OnFailure"); assertThat(podSpec.getContainers()).singleElement().satisfies(container -> { assertThat(container.getName()).isEqualTo(jobName); - assertThat(container.getEnv()).filteredOn(env -> "QUARKUS_FLYWAY_ENABLED".equals(env.getName())) - .singleElement().satisfies(env -> { - assertThat(env.getValue()).isEqualTo("true"); - }); assertThat(container.getEnv()) .filteredOn(env -> "QUARKUS_INIT_AND_EXIT".equals(env.getName())).singleElement() .satisfies(env -> {