Skip to content

Move fabric8 discovery to listers#2133

Draft
wind57 wants to merge 31 commits intospring-cloud:mainfrom
wind57:move-fabric8-discovery-to-listers
Draft

Move fabric8 discovery to listers#2133
wind57 wants to merge 31 commits intospring-cloud:mainfrom
wind57:move-fabric8-discovery-to-listers

Conversation

@wind57
Copy link
Contributor

@wind57 wind57 commented Feb 2, 2026

No description provided.

wind57 added 13 commits February 2, 2026 23:40
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
}

@Bean
@ConditionalOnMissingBean
Copy link
Contributor Author

@wind57 wind57 Feb 5, 2026

Choose a reason for hiding this comment

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

we used to create this one in place where needed, but then I noticed that in the k8s-client native, we create in the auto-configuration. So I decided to do it in the fabric8 case too.

Also, it simplifies testing a lot, having it as a Bean

LogFactory.getLog(Fabric8AbstractBlockingDiscoveryClient.class));

private final KubernetesDiscoveryProperties properties;
private final List<Lister<Service>> serviceListers;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Listers and Informers here, just like the case for the k8s-native client. Unlike the native client, we don't have to deal with SharedInfomerFactory, so a bit simpler


List<Endpoints> allEndpoints = endpoints(properties, client, namespaceProvider, "fabric8-discovery", serviceId,
predicate);
List<Service> allServices = serviceListers.stream()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a 1-1 mapping with k8s-native, meaning we do things the same here, much easier to reason like this

Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Signed-off-by: wind57 <eugen.rabii@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants