Skip to content

Incorrect profile hadling of properties using AwsS3 repository #2815

Closed
@Husted-1

Description

@Husted-1

I'm not sure if this is a duplicate, but it could be of this one: #2018

Using Git, and also back when I started using SVN, it is posible to have more profiles in the same file, active profile cased based.

a: 0
---
spring:
  config:
    activate:
      on-profile: test1
a: 1
---
spring:
  config:
    activate:
      on-profile: test2
a: 2

This doesn't work with the S3 implementation, as, if normal properties file it just loads all into a Properties object, and if yml using YamlPropertiesFactoryBean that reads from a YAML source, exposing a flat structure of String property values - this will end up always getting the last set property in the file and not a result based on the active profile.

https://github.com/spring-cloud/spring-cloud-config/blob/main/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/AwsS3EnvironmentRepository.java - line 268 and 292.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions