Skip to content

Commit

Permalink
test (quarkusio#10620): labels on ingress and routes
Browse files Browse the repository at this point in the history
  • Loading branch information
iocanel authored and gsmet committed Jul 1, 2020
1 parent f63903d commit 532ba43
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ public void assertGeneratedResources() throws IOException {

assertThat(kubernetesList).filteredOn(i -> "Ingress".equals(i.getKind())).hasOnlyOneElementSatisfying(i -> {
assertThat(i).isInstanceOfSatisfying(Ingress.class, in -> {
//Check that lables and annotations are also applied to Ingresses (#10260)
assertThat(i.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("test-it");
assertThat(m.getLabels()).contains(entry("foo", "bar"));
assertThat(m.getAnnotations()).contains(entry("bar", "baz"));
});

assertThat(in.getSpec().getRules()).hasOnlyOneElementSatisfying(r -> {
assertThat(r.getHost()).isEqualTo("example.com");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.PodSpec;
import io.fabric8.kubernetes.api.model.Service;
import io.fabric8.openshift.api.model.Route;
import io.quarkus.test.ProdBuildResults;
import io.quarkus.test.ProdModeTestResults;
import io.quarkus.test.QuarkusProdModeTest;
Expand Down Expand Up @@ -66,6 +67,15 @@ public void assertGeneratedResources() throws IOException {
});
});

assertThat(openshiftList).filteredOn(h -> "Route".equals(h.getKind())).hasSize(1);
assertThat(openshiftList).filteredOn(i -> "Route".equals(i.getKind())).hasOnlyOneElementSatisfying(i -> {
assertThat(i).isInstanceOfSatisfying(Route.class, in -> {
//Check that lables and annotations are also applied to Routes (#10260)
assertThat(i.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("test-it");
assertThat(m.getLabels()).contains(entry("foo", "bar"));
assertThat(m.getAnnotations()).contains(entry("bar", "baz"));
});
});
});
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
quarkus.http.port=9090
quarkus.kubernetes.name=test-it
quarkus.kubernetes.labels.foo=bar
quarkus.kubernetes.annotations.bar=baz
quarkus.kubernetes.env-vars.my-env-var.value=SOMEVALUE
quarkus.kubernetes.env-vars.my-name.field=metadata.name
quarkus.container-image.group=grp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ quarkus.http.port=9090
quarkus.kubernetes.deployment-target=openshift
quarkus.openshift.name=test-it
quarkus.openshift.labels.foo=bar
quarkus.openshift.annotations.bar=baz
quarkus.openshift.env-vars.my-env-var.value=SOMEVALUE
quarkus.openshift.group=grp
quarkus.openshift.expose=true
Expand Down

0 comments on commit 532ba43

Please sign in to comment.