Skip to content

spring.profiles.include must be a comma separated value in contrast to to non-cloud usage #1417

Open
@elmuerte

Description

@elmuerte

Describe the bug
According to the documentation for spring.profiles.include the value for spring.profiles.include is a list.

spring.profiles.include[0]=common
spring.profiles.include[1]=local

But using this in a configuration file provided via cloud config it does not work. Instead it expects the value to be a comma separated string value:

spring.profiles.include=common,local

The offending code:

https://github.com/spring-cloud/spring-cloud-commons/blob/main/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapConfiguration.java#L306-L317

In Spring Boot the configuration setting is processed as a string list:

https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironment.java#L291-L310

The difference in behavior is not documented anywhere.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions