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

Fix properties retrieval order from configmaps #1291

Merged
merged 1 commit into from
Apr 7, 2023
Merged

Fix properties retrieval order from configmaps #1291

merged 1 commit into from
Apr 7, 2023

Conversation

disimo74
Copy link
Contributor

@disimo74 disimo74 commented Apr 7, 2023

The properties defined by the configmap "application" should be the last in the environment list, so you can always override the properties values by profile and by application

@wind57
Copy link
Contributor

wind57 commented Apr 7, 2023

I guess some tests would nice to have here...

eq(null), eq(null), eq(null), eq(null))).thenReturn(CONFIGMAP_DEV_LIST);
KubernetesEnvironmentRepository environmentRepository = new KubernetesEnvironmentRepository(coreApi,
kubernetesPropertySourceSuppliers, "default");
Environment environment = environmentRepository.findOne("stores-dev", "", "");
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I agree with this test. Don't you need to assert order here? Cause right now you are asserting only for presence.

Copy link
Contributor Author

@disimo74 disimo74 Apr 7, 2023

Choose a reason for hiding this comment

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

I can change the test checking that the last configmap on the list is "application" but what I want with this test is to allow to override the properties in "application" configmap with properties in more specific configmaps.
So without the fix this test fails because the fist configmap retrieved is the "application" configmap.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah! indeed, that makes sense.

The properties defined by the configmap "application" should be the last in the environment list, so you can always override the properties values by profile and by application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kubernetes Config Server evaluates application config map in wrong order
4 participants