Skip to content

Conversation

wind57
Copy link
Contributor

@wind57 wind57 commented Mar 12, 2023

No description provided.


}

public Metadata(@DefaultValue("true") boolean addLabels, String labelsPrefix,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add a new constructor not to break the public existing one

this(instanceId, serviceId, host, port, metadata, secure, null, null, Map.of(), Map.of());
}

public DefaultKubernetesServiceInstance(String instanceId, String serviceId, String host, int port,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

keep the previous constructor intact and introduce a new one

@wind57 wind57 marked this pull request as ready for review March 13, 2023 05:19
@wind57
Copy link
Contributor Author

wind57 commented Mar 13, 2023

@ryanjbaxter ready to look at. thank you.

}

@Override
public Map<String, String> podLabels() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to not just put this in the metadata?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was afraid that service labels and pod labels could create a mess if put together, like what if labels colide? i thought that separating them would be cleaner.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that is kind of what I was saying here....I suppose there is no other way, we either run the risk of colliding or we separate things.

Since we have some freedom here with this new property could we make it Map<String, Map<String, String> call it podMetadata and put both labels and annotations in that map?

Copy link
Contributor Author

@wind57 wind57 Mar 13, 2023

Choose a reason for hiding this comment

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

this is where I was hesitant too, I thought not everyone is interested in one or the other... I don't know. I'll listen to your advice here. I mean what if you want to separate your logic on labels only, for example?

Copy link
Contributor

Choose a reason for hiding this comment

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

if you enable one or the other only that one would be added to the map

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my turn to miss-read!

Map<String, Map<String, String>

so something like : labels = {a = b} and annotations = {c = d}, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

correct

@wind57 wind57 requested a review from ryanjbaxter March 14, 2023 12:47
@ryanjbaxter ryanjbaxter added this to the 3.0.2 milestone Mar 14, 2023
@ryanjbaxter ryanjbaxter merged commit e099d73 into spring-cloud:main Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants