Skip to content

Properties bound in the child management context ignore the parent's environment prefix #45858

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

Open
wilkinsona opened this issue Jun 9, 2025 · 2 comments
Labels
type: bug A general bug
Milestone

Comments

@wilkinsona
Copy link
Member

Property binding performed in the child management context, for example through @EnableConfigurationProperties on a @ManagementContextConfiguration(ManagementContextType.CHILD) class, ignores the parent's environment prefix. It appears to be lost in ManagementContextFactory when creating the environment for the child context.

@wilkinsona wilkinsona added this to the 3.4.x milestone Jun 9, 2025
@wilkinsona wilkinsona added the type: bug A general bug label Jun 9, 2025
wilkinsona added a commit that referenced this issue Jun 10, 2025
Binding in the child context does not work correctly when an
environment prefix has been configured. The prefix is not applied
to the child context's Environment and, therefore, prefixed
environment variables are ignored during binding.

We can fix the problem by reusing the parent context's
ManagementServerProperties rather than binding them again in the
child context. Doing so will fix the problem reported in gh-45857
that was introduced in 020fd7b and will also avoid an unnecessary
second binding of the properties.

gh-45858 may fix the problem more generally by applying the prefix
to the child context's environment. This would benefit situations
where the properties need to be bound in the child context because
they haven't already been bound in the parent.

Closes gh-45847
@Somesh-coding

This comment has been minimized.

@wilkinsona

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants