Skip to content

defaultProperties property source is not propagated to the new context created in the LegacyContextRefresher for refreshing properties #892

@mzeijen

Description

@mzeijen

Bug introduced with Spring Cloud Context version: 3.0.0

When the LegacyContextRefresher is used to refresh the Spring environment properties, the temporary context created by the LegacyContextRefresher, does no longer get the defaultProperties property source propagated from the original environment.

The reason for this is because the properties method of the SpringApplicationBuilder is now used to provide the spring.cloud.bootstrap.enabled=true property to the builder. This results in the defaultProperties property source from the copied environment to be overwritten by a new property map containing only the spring.cloud.bootstrap.enabled property.

To put this in sequence (with line references to the code):

The solution would be to provide the spring.cloud.bootstrap.enabled=true via other means, for instance by adding it to the default properties of the copied environment, instead of using the properties method of the SpringApplicationBuilder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions