Skip to content

Expose profile metadata in Config Server property sources - #3301

Open
yashdotdev13 wants to merge 1 commit into
spring-cloud:mainfrom
yashdotdev13:fix/1874-profile-config-response
Open

yashdotdev13 wants to merge 1 commit into
spring-cloud:mainfrom
yashdotdev13:fix/1874-profile-config-response

Conversation

@yashdotdev13

Copy link
Copy Markdown
Contributor

Description

Resolves #1874

This change exposes the profile associated with a StandardConfigDataResource in the Config Server PropertySource response.

Previously, ConfigServerConfigDataLoader determined whether a property source was profile-specific primarily by matching the profile against the property source name. This can be unreliable when the profile is not part of the property source name.

Changes

  • Add profile metadata to the Config Server PropertySource DTO.
  • Extract the profile from StandardConfigDataResource in NativeEnvironmentRepository.
  • Propagate the profile metadata to the Config Server response.
  • Update ConfigServerConfigDataLoader to use the explicit profile metadata when available.
  • Retain the existing property-source name matching as a fallback for compatibility with Config Server versions that do not provide profile metadata.
  • Add a regression test covering a profile-specific property source whose name does not contain the profile.

Tests

  • ConfigDataProfileOnlyTests — 2 tests passed
  • ConfigServerConfigDataLoaderTests — 35 tests passed, 3 skipped

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add profile to config server response data

2 participants