You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for merging multiple config files from variable (#43)
To better support the use-case of dynamically generating configs from other configs and variables, the following changes are made:
- Added `paths` to `file` config source. Either the existing `path` or `paths` is required.
- All the files listed in `paths` are merged using `mergo` with `mergo.WithOverride` and `mergo.WithOverwriteWithEmptyValue`
- config source's `paths` and `path` can now refer to `var`s. `variant` internally builds a DAG of `var`s, `conf`s, and `sec`s to make it possible.
- Added `function` block to define user-functions, with support for recursive call. Note that user-functions are visible within a variant command that defines it.
- This means two things:
- You can't `import` user-functions
- User-functions defined in the parent variant command are not visible to imported variant commands.
- Added new example for config-depends-on-var use-case at `examples/advanced/dynamic-config-inheritance`
- Added new example for importing variant command with local user-function at `examples/advanced/userfunc-local-scope`
Resolves#42
Use the same version of sdk as variant for `variant export` (#41)
This changes the build and release scripts to embed the version number of variant deduced from GITHUB_REF in GitHub Actions, and enhances `variant export` to embed that version in generated go.mod files.
Fixes#36
Merge configs by overriding with empty values (#34)
Upgrades mergo to the version that has support for the WithOverwriteWithEmptyValue option that enables merging non-empty values in the destination config with empty values from the source config.
Fixes#33