Skip to content

Commit

Permalink
Merge pull request quarkusio#25220 from Sgitario/fix_knative_expose
Browse files Browse the repository at this point in the history
Knative: fix clusterLocal property
  • Loading branch information
geoand authored May 10, 2022
2 parents 34141c6 + c2bb7b9 commit 6225daa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://knative.dev/docs/serving/services/private-services/">this link</a>.
*/
@ConfigItem
public boolean clusterLocal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public List<DecoratorBuildItem> 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")));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
});
});
}
Expand Down

0 comments on commit 6225daa

Please sign in to comment.