Steeltoe
Steeltoe copied to clipboard
Configuration properties sections are case sensitive
Describe the bug
When i define my app configuration as per https://docs.steeltoe.io/api/v3/discovery/netflix-eureka.html it is not using the values I am supplying via my configuration layer. If i change the sections key to lower case they do correctly resolve.
Steps to reproduce
Steps to reproduce the behavior:
- Have a configuration provider generate config as per below
Data.Add("Eureka:Instance:InstanceId", $"192.168.1.1:90"); - Run the application register with a eureka instance
- Observe that the instanceid received is "localhost:{{appName}}:{{port}}"
- Change configuration key to be
Data.Add("eureka:instance:InstanceId", $"192.168.1.1:90"); - Observe instanceid is now set correctly
Expected behavior
The configuration parameters are not case sensitive
Environment (please complete the following information):
- Steeltoe Version 3.2.6
- OS: Windows
- .NET Version Net 8
I suspect there's something wrong with your app configuration layer, or it executes too late. I'm unable to reproduce this against Steeltoe 3.x. I've tried the following:
- Open https://github.com/SteeltoeOSS/Samples/blob/main/Discovery/src/FortuneTeller.sln, set Fortune-Teller-Service as startup project
- Add the following line to
Program.cs, between.AddCloudFoundryConfiguration()and.AddAllActuators():ConfigureAppConfiguration(builder => builder.AddInMemoryCollection(new Dictionary<string, string> { { "Eureka:Instance:InstanceId", "some" } })) - Start Eureka docker container
- Select the Fortune-Teller-Service launch profile, run the project, and navigate to http://localhost:8761/eureka/apps
- The registered app shows up with Instance ID "some", see below:
Can you provide reproduction steps, so it can be reproduced and debugged?
i know that it is not an issue with config layer ordering as if I change the casing it correctly resolves it.
Would it be helpful if I make a basic repo branch rather than try an describe it?
I would prefer if you try to reproduce the problem with our sample, gradually adding parts from your app until it breaks.
Sure thing will do that
hmm, this is interesting. I have brought across my entire configuration layer and can't reproduce it. Changing the casing still results in it working. Maybe some serialisation behaviour differs? But will need to look into this further.
Thanks for investigating. I'm closing this, as it doesn't seem to be a Steeltoe issue. Feel free to open a new issue when you've identified what's going on.