Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ServiceMonitor generation (targetPort type and dekorate bump) #37709

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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