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

Let The Config Server Handle Multiple Labels Instead Of The Client #2583

Closed
ryanjbaxter opened this issue Oct 10, 2024 · 0 comments · Fixed by #2602
Closed

Let The Config Server Handle Multiple Labels Instead Of The Client #2583

ryanjbaxter opened this issue Oct 10, 2024 · 0 comments · Fixed by #2602
Assignees
Milestone

Comments

@ryanjbaxter
Copy link
Contributor

The Spring Cloud Config server can now support multiple labels (#2449). The config client no longer needs to worry about handling that on the client side.

String[] labels = new String[] { "" };
if (StringUtils.hasText(properties.getLabel())) {
labels = StringUtils.commaDelimitedListToStringArray(properties.getLabel());
}
String state = ConfigClientStateHolder.getState();
// Try all the labels until one works
for (String label : labels) {
Environment result = getRemoteEnvironment(context, resource, label.trim(), state);
if (result != null) {
log(result);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
1 participant