From c2bb7b9a494f4307a62dacb5f4b0ce1f4384c678 Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 28 Apr 2022 13:13:49 +0200 Subject: [PATCH] Knative: fix clusterLocal property According to https://knative.dev/docs/serving/services/private-services/, the right property is `networking.knative.dev/visibility`, not `serving.knative.dev/visibility`. --- .../java/io/quarkus/kubernetes/deployment/KnativeConfig.java | 1 + .../java/io/quarkus/kubernetes/deployment/KnativeProcessor.java | 2 +- .../java/io/quarkus/it/kubernetes/KnativeClusterLocalTest.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeConfig.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeConfig.java index f10ef9eac00c3..cab1095a06df9 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeConfig.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeConfig.java @@ -388,6 +388,7 @@ public EnvVarsConfig getEnv() { /** * Whether or not this service is cluster-local. * Cluster local services are not exposed to the outside world. + * More information in this link. */ @ConfigItem public boolean clusterLocal; diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeProcessor.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeProcessor.java index 27c98fe46f953..3d4db237b55cb 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeProcessor.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeProcessor.java @@ -175,7 +175,7 @@ public List createDecorators(ApplicationInfoBuildItem applic if (config.clusterLocal) { result.add(new DecoratorBuildItem(KNATIVE, - new AddLabelDecorator(name, "serving.knative.dev/visibility", "cluster-local"))); + new AddLabelDecorator(name, "networking.knative.dev/visibility", "cluster-local"))); } /** diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeClusterLocalTest.java b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeClusterLocalTest.java index 9c121fe528a68..07596394c4b5b 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeClusterLocalTest.java +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KnativeClusterLocalTest.java @@ -38,7 +38,7 @@ public void assertGeneratedResources() throws IOException { assertThat(getKNativeService(kubernetesDir)).satisfies(service -> { assertThat(service.getMetadata()).satisfies(m -> { - assertThat(m.getLabels()).contains(entry("serving.knative.dev/visibility", "cluster-local")); + assertThat(m.getLabels()).contains(entry("networking.knative.dev/visibility", "cluster-local")); }); }); }