Hi all!
I’ve been playing around with split configs, and I noticed something that seemed like an expected behavior, but an interesting nuance.
suppose the following configuration:
.
└── config
├── _default
│ ├── config.yaml
│ ├── languages.yaml
│ ├── menus.yaml
│ └── params.yaml
├── dev
│ ├── config.yaml
│ ├── languages.yaml
│ ├── menus.yaml
│ └── params.yaml
├── playground
│ ├── config.yaml
│ ├── languages.yaml
│ ├── menus.yaml
│ └── params.yaml
└── production
├── config.yaml
├── languages.yaml
├── menus.yaml
└── params.yaml
I believe environmental overrides in stub-files will occur as expected.
If, however, the configuration file structure is instead:
.
└── config
├── config.yaml
├── dev
│ ├── config.yaml
│ ├── languages.yaml
│ ├── menus.yaml
│ └── params.yaml
├── playground
│ ├── config.yaml
│ ├── languages.yaml
│ ├── menus.yaml
│ └── params.yaml
└── production
├── config.yaml
├── languages.yaml
├── menus.yaml
└── params.yaml
it seems like the environment-scoped sub-files aren’t used to override values found in config/config.yaml
I found similar behavior when the config topology looks like this:
.
└── config
├── _default
│ └── config.yaml
├── dev
│ ├── config.yaml
│ ├── languages.yaml
│ ├── menus.yaml
│ └── params.yaml
├── playground
│ ├── config.yaml
│ ├── languages.yaml
│ ├── menus.yaml
│ └── params.yaml
└── production
├── config.yaml
├── languages.yaml
├── menus.yaml
└── params.yaml
changes made to config/dev/params.yaml
wouldn’t be integrated into the running config when running the ‘dev’ environment…
I believe this behavior is as-intended… as in:
“a configuration sub-element file must exist in the _default
dir in order for the environmental file collector to know what to look for”
IE: if a file “FILE-IN-QUESTION
” exists in _default
, it will look for FILE-IN-QUESTION
in {configDir}/{environment}/FILE-IN-QUESTION however if the file doesn’t exist in _default
, the assumption is that there is nothing to environmentally override…
A) Is my question grokable? or do I need to rephrase it?
B) IF grokable, is my understanding correct?
Thanks in advance!
Really enjoying hugo the more I get the hang of it.