Skip to content

Commit

Permalink
Merge pull request #26285 from geoand/#26273
Browse files Browse the repository at this point in the history
Allow overriding of app.openshift.io/runtime label
  • Loading branch information
gsmet authored Jun 27, 2022
2 parents d1443c9 + 249c153 commit ad8feb1
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 ad8feb1

Please sign in to comment.