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.
Comment From: Somesh-coding
Hi 👋, I would like to work on this issue. Can you please assign it to me?
Comment From: wilkinsona
@Somesh-coding thank you for your enthusiasm, but please don't comment on multiple issues at the same time asking to work on them. If you're keen to contribute, please keep an eye out for issues labelled with https://github.com/spring-projects/spring-boot/labels/status%3A%20ideal-for-contribution instead.
Comment From: YongGoose
@wilkinsona
I’m interested in addressing this issue. 🚀
After analyzing it, I concluded that modifying the createManagementContext
method in ManagementContextFactory
should resolve it. I’m currently considering which of the parent’s PropertySources
should be copied and added to the child.
What are your thoughts on this?
Comment From: wilkinsona
I'm a little hazy on the details but my recollection is that there's no need to copy any property sources over – it's the enviroment prefix that's missing.
Comment From: YongGoose
Please take a look :) - https://github.com/spring-projects/spring-boot/pull/46879