Skip to content

Commit 3898c7d

Browse files
committed
fix(jkube-healthcheck-spring-boot enricher)!: rename property management.health.probes.enabled
BREAKING CHANGE: Rename management.health.probes.enabled to management.endpoint.health.probes.enabled, since spring boot 2.3.2 Fix #3690
1 parent 9c7d1e4 commit 3898c7d

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Usage:
2121
./scripts/extract-changelog-for-version.sh 1.3.37 5
2222
```
2323
### 1.19-SNAPSHOT
24+
* Fix #3690: jkube-healthcheck-spring-boot enricher: rename property management.health.probes.enabled
2425

2526
### 1.18.1 (2025-02-11)
2627
* Fix #3642: Config properties resolved for generated images

gradle-plugin/it/src/it/spring-boot-managementhealthprobes/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# Red Hat, Inc. - initial API and implementation
1313
#
1414

15-
management.health.probes.enabled=true
15+
management.endpoint.health.probes.enabled=true

jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/SpringBootConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static SpringBootConfiguration from(JavaProject project) {
5858
.managementPort(Optional.ofNullable(properties.getProperty("management.port")).map(Integer::parseInt).orElse(null))
5959
.serverPort(Integer.parseInt(properties.getProperty("server.port", DEFAULT_SERVER_PORT)))
6060
.serverKeystore(properties.getProperty("server.ssl.key-store"))
61-
.managementHealthProbesEnabled(Boolean.parseBoolean(properties.getProperty("management.health.probes.enabled")))
61+
.managementHealthProbesEnabled(Boolean.parseBoolean(properties.getProperty("management.endpoint.health.probes.enabled")))
6262
.managementKeystore(properties.getProperty("management.ssl.key-store"))
6363
.servletPath(properties.getProperty("server.servlet-path"))
6464
.serverContextPath(properties.getProperty("server.context-path"))

jkube-kit/doc/src/main/asciidoc/inc/enricher/spring-boot-healthcheck/_jkube_healthcheck_spring_boot.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ If you're using Spring Boot WebFlux, this enricher would automatically read `spr
1616

1717
The enricher will try to discover the settings from the `application.properties` / `application.yaml` Spring Boot configuration file.
1818

19-
`/actuator/health` is the default endpoint for the liveness and readiness probes.
19+
`/actuator/health` is the default endpoint for the liveness and readiness probes, you can change it by setting the property `management.endpoints.web.base-path`.
2020

21-
If the user has enabled the `management.health.probes.enabled` property this Enricher uses the `/actuator/health/liveness` as liveness and `/actuator/health/readiness` as readiness probe endpoints instead.
21+
If the user has enabled the `management.endpoint.health.probes.enabled` property this Enricher uses the `/actuator/health/liveness` as liveness and `/actuator/health/readiness` as readiness probe endpoints instead.
2222
[source,properties]
2323
----
24-
management.health.probes.enabled=true
24+
management.endpoint.health.probes.enabled=true
2525
----
2626

2727
The port number is read from the `management.port` option, and will use the default value of `8080`

jkube-kit/jkube-kit-spring-boot/src/test/java/org/eclipse/jkube/springboot/enricher/AbstractSpringBootHealthCheckEnricherTestSupport.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ void testCustomPropertiesForLivenessAndReadiness() {
661661

662662
@Test
663663
void testBuildProbeExplicitPathCreation_whenManagementHealthProbesEnabledIsTrue(){
664-
props.put("management.health.probes.enabled","true");
664+
props.put("management.endpoint.health.probes.enabled","true");
665665
writeProps();
666666

667667
Probe readinessProbe = new SpringBootHealthCheckEnricher(context).buildProbe(10, null, null, 3, 1,"/example");
@@ -670,7 +670,7 @@ void testBuildProbeExplicitPathCreation_whenManagementHealthProbesEnabledIsTrue(
670670

671671
@Test
672672
void testBuildProbeDefaultPathCreation_whenManagementHealthProbesEnabledIsFalse(){
673-
props.put("management.health.probes.enabled","false");
673+
props.put("management.endpoint.health.probes.enabled","false");
674674
writeProps();
675675

676676
Probe readinessProbe = new SpringBootHealthCheckEnricher(context).buildProbe(10, null, null, 3, 1,"/example");
@@ -679,7 +679,7 @@ void testBuildProbeDefaultPathCreation_whenManagementHealthProbesEnabledIsFalse(
679679

680680
@Test
681681
void testLivenessAndReadinessProbesForExplicitPath_whenManagementHealthProbesEnabledIsTrue(){
682-
props.put("management.health.probes.enabled","true");
682+
props.put("management.endpoint.health.probes.enabled","true");
683683
writeProps();
684684

685685
when(context.getProjectClassLoaders().isClassInCompileClasspath(true, REQUIRED_CLASSES))
@@ -712,7 +712,7 @@ void testLivenessAndReadinessProbesForDefaultPath_whenDefaultConfigUsed(){
712712

713713
@Test
714714
void testLivenessAndReadinessProbesForDefaultPath_whenManagementHealthProbesEnabledIsFalse(){
715-
props.put("management.health.probes.enabled","false");
715+
props.put("management.endpoint.health.probes.enabled","false");
716716
writeProps();
717717

718718
when(projectClassLoaders.isClassInCompileClasspath(true, REQUIRED_CLASSES))

0 commit comments

Comments
 (0)