Repository navigation
Retain probe defaults when configuring other properties on probe health groups - #50296
Conversation
fab15cd to
695e192
Compare
| @@ -42,22 +42,27 @@ | |||
| * @author Phillip Webb | |||
| * @author Brian Clozel | |||
| * @author Madhura Bhave | |||
| * @author htjworld | |||
There was a problem hiding this comment.
Checkstyle requires @author to match .+\s.+. Would you prefer to update this or remove it?
There was a problem hiding this comment.
Thanks, I've updated it to Taejin Han. I've also added the tag to the two test classes that this change modifies substantially. checkstyleMain and checkstyleTest now pass for the spring-boot-health module.
| @@ -28,20 +28,24 @@ | |||
| * | |||
| * @author Phillip Webb | |||
| * @author Madhura Bhave | |||
| * @author htjworld | |||
There was a problem hiding this comment.
Checkstyle requires @author to match .+\s.+. Would you prefer to update this or remove it?
There was a problem hiding this comment.
Updated here as well.
| @@ -28,23 +32,27 @@ | |||
| * existing group. | |||
| * | |||
| * @author Madhura Bhave | |||
| * @author htjworld | |||
There was a problem hiding this comment.
Checkstyle requires @author to match .+\s.+. Would you prefer to update this or remove it?
There was a problem hiding this comment.
Updated here as well.
695e192 to
43b1263
Compare
See spring-projectsgh-50296 Signed-off-by: htjworld <[email protected]>
43b1263 to
5a27fd9
Compare
|
Thanks very much, @htjworld. |
|
Thank you very much for the review. |
Problem
Configuring
additional-path(or other unrelated properties) on thelivenessorreadinesshealth groups causes those groups to beredefined via
AutoConfiguredHealthEndpointGroupswith an emptyincludeset, which matches all indicators rather than retaining theprobe defaults (
livenessState/readinessStateonly). This can causeKubernetes probes to fail due to unrelated indicators (e.g.
diskSpace,rabbit).Change
AvailabilityProbesHealthEndpointGroupsnow checks whether the user hasexplicitly set
includeorexcludeon a probe group viaHealthEndpointProperties. When neither is set, it wraps the existinggroup in a
DelegatingAvailabilityProbesHealthEndpointGroupwith theprobe-specific member set, while delegating all other properties
(show-details, status aggregator, additional path, etc.) to the
existing group.
The fix is applied at the
AvailabilityProbesHealthEndpointGroupslevel rather than in
AutoConfiguredHealthEndpointGroupsbecause onlythe probe layer knows which groups are probe groups and what their
default members are (
livenessState,readinessState).Tests
Added:
getWhenProbeInDelegateWithPropertiesGroupButNoMembershipRetainsProbeDefaultsreproduces the exact bug scenario (
additional-pathset, noinclude/exclude)getWhenProbeInDelegateWithNoExplicitMembershipRetainsProbeDefaultsgetWhenReadinessProbeInDelegateWithNoExplicitMembershipRetainsProbeDefaultsgetWhenProbeInDelegateWithExplicitIncludeReturnsOriginalGroupverifies that an explicitly configured
includeis still respectedUpdated:
getWhenProbeInDelegateReturnsOriginalGroupandgetWhenProbeInDelegateAndExistingAdditionalPathReturnsOriginalGroupwere asserting that the original group was returned unchanged — which
was the buggy behavior. These have been replaced by tests that assert
the corrected behavior.
Closes gh-40268