Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use QUARKUS_FLYWAY_ACTIVE instead of QUARKUS_FLYWAY_ENABLED env in Kubernetes resources #44468

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ 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", "QUARKUS_FLYWAY_ACTIVE", "true"))
.withAppEnvVars(Map.of("QUARKUS_FLYWAY_ACTIVE", "false"))
.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,7 +65,7 @@ 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()))
assertThat(container.getEnv()).filteredOn(env -> "QUARKUS_FLYWAY_ACTIVE".equals(env.getName()))
.singleElement().satisfies(env -> {
assertThat(env.getValue()).isEqualTo("true");
});
Expand Down