Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify new suppliers introduced previously #1400

Conversation

wind57
Copy link
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
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
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
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
26 checks passed
@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