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

Load from multiple labels does not work as expected when %00 (empty label) is used #655

Closed
valmol opened this issue Mar 30, 2020 · 4 comments
Assignees

Comments

@valmol
Copy link

valmol commented Mar 30, 2020

Try to find: key=config.message and label=foo
Value with label foo does not exist, while values with empty label does exist.
Load from multiple labels does not work as expected when %00 (empty label) is used
It is expected to get a value with empty label

bootstrap.properties:

spring.cloud.azure.appconfiguration.stores[0].label=spring.cloud.azure.appconfiguration.stores[0].label= %00, foo

App config:

Key Value Cool
/application/config.message Label (No Label)
  Dev Label dev
  Pro Label pro

Library:

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>spring-cloud-azure-appconfiguration-config</artifactId>
    <version>1.2.2</version>
</dependency>

Azure App Configuration for Spring Cloud:
https://github.com/microsoft/spring-cloud-azure/tree/master/spring-cloud-azure-starters/spring-cloud-starter-azure-appconfiguration-config

Expected Behavior

Get "Label"

Current Behavior

Get "Pro Label"

Steps to Reproduce (for bugs)

Your Environment

  • SDK version: JDK 11
@mrm9084 mrm9084 self-assigned this Mar 30, 2020
@mrm9084
Copy link
Collaborator

mrm9084 commented Mar 30, 2020

@valmol thanks for reporting the issue.

There seems to be a number of issues here. Documentation wise %00 is null which returns all values.

To get what you want your label value should be spring.cloud.azure.appconfiguration.stores[0].label= prod,, but that doesn't seem to work in the current version. I am looking into a solution to the issue.

There might be a bit of confusion here where the right most label has priority. So for example
spring.cloud.azure.appconfiguration.stores[0].label= a,b,c

Key Value Label
/application/config.message Label A a
Label B b
Label C c
/application/config.second Second Value a
Second B b
/application/config.third Third Value a

In this case the returned values would be
config.message= Label C
config.second= Second B
config.third= Third Value

@mrm9084
Copy link
Collaborator

mrm9084 commented Apr 30, 2020

@valmol This should be fixed in the new release 1.2.4, but is should be either
spring.cloud.azure.appconfiguration.stores[0].label=,foo
or
spring.cloud.azure.appconfiguration.stores[0].label=\0,foo

@saragluna
Copy link
Contributor

@valmol Please try with 1.2.5 since we missed something in the release 1.2.4.

@mrm9084
Copy link
Collaborator

mrm9084 commented Jun 25, 2020

Fixed as a version 1.2.5. Let us know if their are any additional issues.

@mrm9084 mrm9084 closed this as completed Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants