Move service data to commons#1394
Move service data to commons#1394ryanjbaxter merged 7 commits intospring-cloud:3.0.xfrom wind57:move-serviceData-to-commons
Conversation
| Assertions.assertNull(defaultInstance.getCluster()); | ||
| } | ||
|
|
||
| private String filterOnK8sNamespaceAndType(Map<String, String> result) { |
There was a problem hiding this comment.
not removed, but moved to commons
| Assertions.assertTrue(output.getOut().contains("found primary-port-name via 'http' to match port : 8082")); | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
the main idea of the tests remained the same and moved to commons
| return Map.of(); | ||
| } | ||
|
|
||
| static Map<String, String> portsData(List<EndpointSubset> endpointSubsets) { |
There was a problem hiding this comment.
this same logic already existed, since I moved things to commons, this was "split" and was left in fabric8 package
| * - service type | ||
| * </pre> | ||
| */ | ||
| static Map<String, String> serviceMetadata(String serviceId, Service service, |
There was a problem hiding this comment.
not removed, but moved to commons
| /** | ||
| * @author wind57 | ||
| */ | ||
| public final class DiscoveryClientUtils { |
There was a problem hiding this comment.
this PR takes a method from fabric8-discovery (serviceMetadata) and moves it to commons. It does not move it verbatim, but "removes" everything fabric8 specific. For example, we used to do :
service.getMetadata().getLabels()
and now in commons, we expect a Map<String, String> that comes from the same service.getMetadata().getLabels(). Same applies for annotations and ports.
Why do I want to do that? Because I want to align implementations of discovery for fabric8 and k8s and I would like them to delegate calls to the same code in commons, so that they behave exactly the same. I started working on k8s discovery and noticed that if I don't move code to commons in this manner, there will be a lot of duplication...
|
@ryanjbaxter I've started work on aligning k8s and fabric8 discovery, there will be more PRs in this direction from me... |
No description provided.