From fb8e2a5c66868ee95bd51ccd0857c250d1fa1ae3 Mon Sep 17 00:00:00 2001 From: Ioannis Canellos <iocanel@gmail.com> Date: Thu, 16 Jul 2020 09:28:42 +0300 Subject: [PATCH] fix(#8659): knative probe ports are removed. --- .../deployment/ApplyHttpGetActionPortDecorator.java | 4 ++-- .../quarkus/kubernetes/deployment/KubernetesProcessor.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/ApplyHttpGetActionPortDecorator.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/ApplyHttpGetActionPortDecorator.java index f778f4358fffe..d5ae0fb23b241 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/ApplyHttpGetActionPortDecorator.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/ApplyHttpGetActionPortDecorator.java @@ -12,9 +12,9 @@ public class ApplyHttpGetActionPortDecorator extends ApplicationContainerDecorator<HTTPGetActionFluent<?>> { - private final int port; + private final String port; - public ApplyHttpGetActionPortDecorator(int port) { + public ApplyHttpGetActionPortDecorator(String port) { super(ANY, ANY); //We need to apply this to all deployments and all containers. this.port = port; } diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java index 3968115251051..7fb6b5efac625 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java @@ -822,8 +822,10 @@ private void doHandleProbes(String name, String target, Map<String, Integer> por handleLivenessProbe(name, target, livenessProbe, kubernetesHealthLivenessPathBuildItem, session); handleReadinessProbe(name, target, readinessProbe, kubernetesHealthReadinessPathBuildItem, session); - session.resources().decorate(target, - new ApplyHttpGetActionPortDecorator(ports.getOrDefault(HTTP_PORT, DEFAULT_HTTP_PORT))); + + //For knative we want the port to be null + String port = KNATIVE.equals(target) ? null : String.valueOf(ports.getOrDefault(HTTP_PORT, DEFAULT_HTTP_PORT)); + session.resources().decorate(target, new ApplyHttpGetActionPortDecorator(port)); } private void handleLivenessProbe(String name, String target, ProbeConfig livenessProbe,