From 460df0d2a38e74a5af3a0cd72f262f32492bcdfc Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 12 Jun 2023 10:28:00 +0300 Subject: [PATCH] Don't include startup probe for KNative manifests Fixes #33944 --- .../deployment/KubernetesCommonHelper.java | 5 ++++- .../src/it/knative-jib-build-and-deploy/pom.xml | 4 ++++ .../kubernetes/quarkus-standard-way/pom.xml | 17 +++++++++++++++++ .../it/kubernetes/KnativeWithHealthTest.java | 8 +------- ...eWithHealthUsingManagementInterfaceTest.java | 1 + 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java index 31b67b3be770a..b30b7043c81d1 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java @@ -4,6 +4,7 @@ import static io.dekorate.kubernetes.decorator.AddServiceResourceDecorator.distinct; import static io.quarkus.kubernetes.deployment.Constants.DEFAULT_HTTP_PORT; import static io.quarkus.kubernetes.deployment.Constants.HTTP_PORT; +import static io.quarkus.kubernetes.deployment.Constants.KNATIVE; import static io.quarkus.kubernetes.deployment.Constants.QUARKUS_ANNOTATIONS_BUILD_TIMESTAMP; import static io.quarkus.kubernetes.deployment.Constants.QUARKUS_ANNOTATIONS_COMMIT_ID; import static io.quarkus.kubernetes.deployment.Constants.QUARKUS_ANNOTATIONS_VCS_URL; @@ -1012,7 +1013,9 @@ private static List createProbeDecorators(String name, Strin List result = new ArrayList<>(); createLivenessProbe(name, target, livenessProbe, livenessPath).ifPresent(d -> result.add(d)); createReadinessProbe(name, target, readinessProbe, readinessPath).ifPresent(d -> result.add(d)); - createStartupProbe(name, target, startupProbe, startupPath).ifPresent(d -> result.add(d)); + if (!KNATIVE.equals(target)) { // see https://github.com/quarkusio/quarkus/issues/33944 + createStartupProbe(name, target, startupProbe, startupPath).ifPresent(d -> result.add(d)); + } return result; } diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/knative-jib-build-and-deploy/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/knative-jib-build-and-deploy/pom.xml index e1ac9aed55c9a..04e9394fdceb8 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/knative-jib-build-and-deploy/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/knative-jib-build-and-deploy/pom.xml @@ -36,6 +36,10 @@ io.quarkus quarkus-container-image-jib + + io.quarkus + quarkus-smallrye-health + io.quarkus quarkus-junit5 diff --git a/integration-tests/kubernetes/quarkus-standard-way/pom.xml b/integration-tests/kubernetes/quarkus-standard-way/pom.xml index becd9466f2c8f..c5841892d9c2f 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/pom.xml +++ b/integration-tests/kubernetes/quarkus-standard-way/pom.xml @@ -36,6 +36,10 @@ io.quarkus quarkus-kubernetes + + io.quarkus + quarkus-smallrye-health + io.quarkus quarkus-junit5-internal @@ -233,6 +237,19 @@ + + io.quarkus + quarkus-smallrye-health-deployment + ${project.version} + pom + test + + + * + * + + + diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeWithHealthTest.java b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeWithHealthTest.java index fad52a2db7019..db28bc7a1c402 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeWithHealthTest.java +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeWithHealthTest.java @@ -71,13 +71,7 @@ public void assertGeneratedResources() throws IOException { assertNotNull(p.getHttpGet()); assertNull(p.getHttpGet().getPort()); }); - assertThat(c.getStartupProbe()).isNotNull().satisfies(p -> { - assertThat(p.getInitialDelaySeconds()).isEqualTo(5); - assertProbePath(p, "/q/health/started"); - - assertNotNull(p.getHttpGet()); - assertNull(p.getHttpGet().getPort()); - }); + assertThat(c.getStartupProbe()).isNull(); }); }); }); diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeWithHealthUsingManagementInterfaceTest.java b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeWithHealthUsingManagementInterfaceTest.java index be58114f745dd..be15691a9226f 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeWithHealthUsingManagementInterfaceTest.java +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeWithHealthUsingManagementInterfaceTest.java @@ -71,6 +71,7 @@ public void assertGeneratedResources() throws IOException { assertNotNull(p.getHttpGet()); assertNull(p.getHttpGet().getPort()); }); + assertThat(c.getStartupProbe()).isNull(); }); }); });