Skip to content

Commit

Permalink
Merge pull request #37709 from iocanel/service-monitor-fix
Browse files Browse the repository at this point in the history
Fix ServiceMonitor generation (targetPort type and dekorate bump)
  • Loading branch information
iocanel committed Dec 13, 2023
2 parents 3493670 + 3a035d5 commit 07c0c06
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
<kotlin.coroutine.version>1.7.3</kotlin.coroutine.version>
<azure.toolkit-lib.version>0.27.0</azure.toolkit-lib.version>
<kotlin-serialization.version>1.6.2</kotlin-serialization.version>
<dekorate.version>4.1.0</dekorate.version> <!-- Please check with Java Operator SDK team before updating -->
<dekorate.version>4.1.1</dekorate.version> <!-- Please check with Java Operator SDK team before updating -->
<maven-invoker.version>3.2.0</maven-invoker.version>
<awaitility.version>4.2.0</awaitility.version>
<jboss-logmanager.version>3.0.2.Final</jboss-logmanager.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void visit(KubernetesListBuilder list) {
.endSelector()
.addNewEndpoint()
.withScheme(scheme)
.withNewTargetPort(targetPort)
.withNewTargetPort(Integer.parseInt(targetPort)) //This needs to be passed as int
.withPath(path)
.withInterval(interval + "s")
.withHonorLabels(honorLabels)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public void assertGeneratedResources() throws IOException {
assertThat(spec.getEndpoints()).hasSize(1);
assertThat(spec.getEndpoints().get(0)).isInstanceOfSatisfying(Endpoint.class, e -> {
assertThat(e.getScheme()).isEqualTo("http");
assertThat(e.getTargetPort().getStrVal()).isEqualTo("9090");
assertThat(e.getTargetPort().getStrVal()).isNull();
assertThat(e.getTargetPort().getIntVal()).isEqualTo(9090);
assertThat(e.getPath()).isEqualTo("/absolute-metrics");
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public void assertGeneratedResources() throws IOException {
assertThat(spec.getEndpoints()).hasSize(1);
assertThat(spec.getEndpoints().get(0)).isInstanceOfSatisfying(Endpoint.class, e -> {
assertThat(e.getScheme()).isEqualTo("http");
assertThat(e.getTargetPort().getStrVal()).isEqualTo("9090");
assertThat(e.getTargetPort().getStrVal()).isNull();
assertThat(e.getTargetPort().getIntVal()).isEqualTo(9090);
assertThat(e.getPath()).isEqualTo("/q/met");
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public void assertGeneratedResources() throws IOException {
assertThat(spec.getEndpoints()).hasSize(1);
assertThat(spec.getEndpoints().get(0)).isInstanceOfSatisfying(Endpoint.class, e -> {
assertThat(e.getScheme()).isEqualTo("http");
assertThat(e.getTargetPort().getStrVal()).isEqualTo("9090");
assertThat(e.getTargetPort().getStrVal()).isNull();
assertThat(e.getTargetPort().getIntVal()).isEqualTo(9090);
assertThat(e.getPath()).isEqualTo("/q/metrics");
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public void assertGeneratedResources() throws IOException {
assertThat(spec.getEndpoints()).hasSize(1);
assertThat(spec.getEndpoints().get(0)).isInstanceOfSatisfying(Endpoint.class, e -> {
assertThat(e.getScheme()).isEqualTo("http");
assertThat(e.getTargetPort().getStrVal()).isEqualTo("9090");
assertThat(e.getTargetPort().getStrVal()).isNull();
assertThat(e.getTargetPort().getIntVal()).isEqualTo(9090);
assertThat(e.getPath()).isEqualTo("/q/metrics");
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public void assertGeneratedResources() throws IOException {
assertThat(spec.getEndpoints()).hasSize(1);
assertThat(spec.getEndpoints().get(0)).isInstanceOfSatisfying(Endpoint.class, e -> {
assertThat(e.getScheme()).isEqualTo("http");
assertThat(e.getTargetPort().getStrVal()).isEqualTo("8080");
assertThat(e.getTargetPort().getStrVal()).isNull();
assertThat(e.getTargetPort().getIntVal()).isEqualTo(8080);
assertThat(e.getPath()).isEqualTo("/q/metrics");
});
});
Expand Down

0 comments on commit 07c0c06

Please sign in to comment.