Skip to content

Commit

Permalink
Allow overriding of app.openshift.io/runtime label
Browse files Browse the repository at this point in the history
Fixes: quarkusio#26273
(cherry picked from commit 249c153)
  • Loading branch information
geoand authored and gsmet committed Jun 28, 2022
1 parent 33e0fa0 commit 9b6c2b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ public List<DecoratorBuildItem> createDecorators(ApplicationInfoBuildItem applic
});

result.add(new DecoratorBuildItem(OPENSHIFT, new ApplyImagePullPolicyDecorator(name, config.getImagePullPolicy())));
result.add(new DecoratorBuildItem(OPENSHIFT, new AddLabelDecorator(name, OPENSHIFT_APP_RUNTIME, QUARKUS)));

if (labels.stream().noneMatch(l -> l.getKey().equals(OPENSHIFT_APP_RUNTIME))) {
result.add(new DecoratorBuildItem(OPENSHIFT, new AddLabelDecorator(name, OPENSHIFT_APP_RUNTIME, QUARKUS)));
}

Stream.concat(config.convertToBuildItems().stream(),
envs.stream().filter(e -> e.getTarget() == null || OPENSHIFT.equals(e.getTarget()))).forEach(e -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void assertGeneratedResources() throws IOException {
assertThat(openshiftList).filteredOn(h -> "DeploymentConfig".equals(h.getKind())).singleElement().satisfies(h -> {
assertThat(h.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("openshift-v4");
assertThat(m.getLabels().get("app.openshift.io/runtime")).isEqualTo("quarkus");
assertThat(m.getLabels().get("app.openshift.io/runtime")).isEqualTo("test");
assertThat(m.getLabels().get("app.kubernetes.io/name")).isEqualTo("openshift-v4");
assertThat(m.getLabels().get("app")).isNull();
assertThat(m.getNamespace()).isNull();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
quarkus.kubernetes.deployment-target=openshift
quarkus.openshift.flavor=v4
quarkus.openshift.flavor=v4
quarkus.openshift.labels."app.openshift.io/runtime"=test

0 comments on commit 9b6c2b0

Please sign in to comment.