Skip to content

Simplify new suppliers introduced previously#1400

Merged
ryanjbaxter merged 36 commits intospring-cloud:3.0.xfrom
wind57:simplify-new-suppliers-introduced-previously
Aug 7, 2023
Merged

Simplify new suppliers introduced previously#1400
ryanjbaxter merged 36 commits intospring-cloud:3.0.xfrom
wind57:simplify-new-suppliers-introduced-previously

Conversation

@wind57
Copy link
Copy Markdown
Contributor

@wind57 wind57 commented Aug 5, 2023

No description provided.

@wind57 wind57 changed the base branch from main to 3.0.x August 7, 2023 05:04
@@ -46,6 +46,20 @@ public InstanceIdHostPodName get() {
return new InstanceIdHostPodName(instanceId(), host(), podName());
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

now that I have separated things, I can see much easier where things can be improved. This is one of those places, creating static factory methods is far cleaner for callers, otherwise they need to pass "null"s around, and I personally was confused at times too why that is needed. This way, I think it's easier to reason about the code.

/**
* to be used when .spec.type of the Service is != 'ExternalName'
*/
static Fabric8PodLabelsAndAnnotationsSupplier nonExternalName(KubernetesClient client, String namespace) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same thing here: private constructor and dedicated factory methods

@wind57 wind57 marked this pull request as ready for review August 7, 2023 06:45
@wind57
Copy link
Copy Markdown
Contributor Author

wind57 commented Aug 7, 2023

@ryanjbaxter the code has been simplified and this creates opportunities for some more simplifications/improvements. I think a couple of these PRs and I'll start k8s discovery alignment.

@ryanjbaxter ryanjbaxter merged commit 44a0064 into spring-cloud:3.0.x Aug 7, 2023
@ryanjbaxter ryanjbaxter added this to the 3.0.5 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants