Skip to content

Conversation

@wind57
Copy link
Contributor

@wind57 wind57 commented Aug 10, 2025

No description provided.

wind57 added 2 commits August 9, 2025 10:52
Signed-off-by: wind57 <[email protected]>
Signed-off-by: wind57 <[email protected]>
Signed-off-by: wind57 <[email protected]>

@Test
@Override
void testWithoutSubsetsOrEndpoints() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both here and in k8s-native, I've added two tests to cover the cases that the bug describes

List<EndpointNameAndNamespace> generateState(List<EndpointSlice> endpointSlices) {
Stream<ObjectReference> references = endpointSlices.stream()
.map(EndpointSlice::getEndpoints)
.filter(Objects::nonNull)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the actual fix

* V1EndpointSubset::getAddresses and V1EndpointSubset::getPorts (each is a List)
* </pre>
*/
List<EndpointNameAndNamespace> generateState(List<V1Endpoints> endpoints) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract as a separate package-private method to be able to test it

@wind57 wind57 marked this pull request as ready for review August 10, 2025 15:58
@wind57
Copy link
Contributor Author

wind57 commented Aug 10, 2025

@ryanjbaxter ready for review. thank you

@ryanjbaxter ryanjbaxter merged commit b16f279 into spring-cloud:3.2.x Aug 10, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KubernetesCatalogWatch.catalogServicesWatch throws an NPE when endpointslices are not set

3 participants