Skip to content

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

Closed
@onobc

Description

@onobc

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.

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