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

Configuration properties sections are case sensitive #1296

Closed
thompson-tomo opened this issue May 12, 2024 · 6 comments
Closed

Configuration properties sections are case sensitive #1296

thompson-tomo opened this issue May 12, 2024 · 6 comments
Labels
Type/bug Something isn't working

Comments

@thompson-tomo
Copy link
Contributor

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:

  1. Have a configuration provider generate config as per below
    Data.Add("Eureka:Instance:InstanceId", $"192.168.1.1:90");
  2. Run the application register with a eureka instance
  3. Observe that the instanceid received is "localhost:{{appName}}:{{port}}"
  4. Change configuration key to be
    Data.Add("eureka:instance:InstanceId", $"192.168.1.1:90");
  5. 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
@thompson-tomo thompson-tomo added the Type/bug Something isn't working label May 12, 2024
@bart-vmware
Copy link
Member

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:

  1. Open https://github.com/SteeltoeOSS/Samples/blob/main/Discovery/src/FortuneTeller.sln, set Fortune-Teller-Service as startup project
  2. Add the following line to Program.cs, between .AddCloudFoundryConfiguration() and .AddAllActuators():
    ConfigureAppConfiguration(builder => builder.AddInMemoryCollection(new Dictionary<string, string>
    {
        { "Eureka:Instance:InstanceId", "some" }
    }))
  3. Start Eureka docker container
  4. Select the Fortune-Teller-Service launch profile, run the project, and navigate to http://localhost:8761/eureka/apps
  5. The registered app shows up with Instance ID "some", see below:
    image

Can you provide reproduction steps, so it can be reproduced and debugged?

@thompson-tomo
Copy link
Contributor Author

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?

@bart-vmware
Copy link
Member

I would prefer if you try to reproduce the problem with our sample, gradually adding parts from your app until it breaks.

@thompson-tomo
Copy link
Contributor Author

Sure thing will do that

@thompson-tomo
Copy link
Contributor Author

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.

@bart-vmware
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants