Skip to content
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

Clarify relation of import path to resultant properties in configtree import data #29606

Closed
onobc opened this issue Feb 1, 2022 · 0 comments
Closed
Labels
type: documentation A documentation update
Milestone

Comments

@onobc
Copy link
Contributor

onobc commented Feb 1, 2022

The Using Configuration Trees section of the reference docs show the following example:

Given this mounted volume:

etc/
  config/
    myapp/
      username
      password

and this import path:

spring:
  config:
    import: "optional:configtree:/etc/config/"

results in these properties:

myapp.username
myapp.password

However, in a more complicated scenario it may not be clear as to the impact of the import path on the resultant properties.

Given this mounted volume:

etc/
  config/
    myapp/
      username
      password
    secret/
      mysecret

and this import path:

spring:
  config:
    import: "optional:configtree:/etc/config/"

results in these properties:

myapp.username
myapp.password
secret.mysecret

One might think/expect that using an import path of optional:configtree:/etc/config/*/ would instead result in these properties:

myapp.username
myapp.password
mysecret

but it does not.

Proposal

It may be helpful to emphasize the impact of the import path on the resultant properties.

Something simple like this would do:

The folders under the config tree form the property name, so if you have
etc/config/secret/mysecret mounted and you import /etc/config/ you'll get
a property named secret.mysecret.

However, if you import /etc/config/secret you'll get mysecret.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 1, 2022
@mbhave mbhave added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 1, 2022
@mbhave mbhave added this to the 2.5.x milestone Feb 1, 2022
@mbhave mbhave modified the milestones: 2.5.x, 2.5.10 Feb 23, 2022
@mbhave mbhave closed this as completed in cc95f73 Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

3 participants