diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/CreateJobResourceFromImageDecorator.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/CreateJobResourceFromImageDecorator.java index 307f810095ece..c69ca855c51a5 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/CreateJobResourceFromImageDecorator.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/CreateJobResourceFromImageDecorator.java @@ -6,6 +6,8 @@ import java.util.List; +import io.dekorate.kubernetes.annotation.JobCompletionMode; +import io.dekorate.kubernetes.annotation.JobRestartPolicy; import io.dekorate.kubernetes.decorator.ResourceProvidingDecorator; import io.fabric8.kubernetes.api.model.KubernetesListBuilder; import io.fabric8.kubernetes.api.model.batch.v1.JobBuilder; @@ -15,8 +17,8 @@ **/ public class CreateJobResourceFromImageDecorator extends ResourceProvidingDecorator { - private static final String DEFAULT_RESTART_POLICY = "OnFailure"; - private static final String DEFAULT_COMPLETION_MODE = "OnFailure"; + private static final String DEFAULT_RESTART_POLICY = JobRestartPolicy.OnFailure.name(); + private static final String DEFAULT_COMPLETION_MODE = JobCompletionMode.NonIndexed.name(); private final String name; private final String image; diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithFlywayInitTest.java b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithFlywayInitTest.java index 827c7b3c0c7f6..328352faae67f 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithFlywayInitTest.java +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithFlywayInitTest.java @@ -79,8 +79,10 @@ public void assertGeneratedResources() throws IOException { assertThat(job.get()).satisfies(j -> { assertThat(j.getSpec()).satisfies(jobSpec -> { + assertThat(jobSpec.getCompletionMode()).isEqualTo("NonIndexed"); assertThat(jobSpec.getTemplate()).satisfies(t -> { assertThat(t.getSpec()).satisfies(podSpec -> { + assertThat(podSpec.getRestartPolicy()).isEqualTo("OnFailure"); assertThat(podSpec.getContainers()).singleElement().satisfies(container -> { assertThat(container.getName()).isEqualTo("flyway-init"); assertThat(container.getEnv()).filteredOn(env -> "QUARKUS_FLYWAY_ENABLED".equals(env.getName()))