Skip to content

Commit

Permalink
Remove QUARKUS_FLYWAY_ENABLED env from Kubernetes resources
Browse files Browse the repository at this point in the history
Because this is a build-time configuration property, it doesn't make sense to have it added here
  • Loading branch information
gastaldi committed Nov 13, 2024
1 parent 323ba29 commit 1de2d1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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 -> {
Expand All @@ -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 -> {
Expand Down

0 comments on commit 1de2d1f

Please sign in to comment.