Resolving of files (for `insertFile` and `insertTemplate`) should
always be relative to the resource set location, the previous
behaviour was considered a bug.
This is fixed by ensuring that resource set paths are absolute at
context loading time.
Introduces a test which will merge variables defined at every possible
layer together and ensure that the loaded context configuration is as
expected.
The test data provides an actual resource set template that can be
tested locally from a kontemplate source checkout:
kontemplate template context/testdata/merging/context.yaml --var cliVar=cliVar
This lets users specify the paths from which to import additional
variables using absolute paths in addition to relative paths.
This enables both loading of configuration files placed outside of the
resource set folder (if desired), as well as special use-cases such as
specifying `/dev/stdin` as an input path to read variables from
standard input.
This change supersedes #131
The hierarchy for loading variables was previously not expressed
explicitly.
This commit refactors the logic for merging variables to explicitly
set the different layers of variables as values on the context object
and merge them for each resource set in `mergeContextValues`.
These changes allows variables to be defined when executing
`kontemplate` via one or more `--variable` arguments.
With this in place one can either define new variables or override
existing variables loaded from a file:
```
$ kontemplate apply --variable version=v1.0 example/fancy-app.yaml
```
This avoids the need to write variables into a temporary file that is
only needed to provide "external variables" into resource sets.
Closes https://github.com/tazjin/kontemplate/issues/122
Instead of always inferring the path at which files in a resource set
are located, let users override the path by specifying a `path` field.
This makes it possible to add the same resource set multiple times
with different values while still keeping distinct names for
addressability (for example when using include/exclude).
This fixes#70
Kontemplate context specifications can now load extra variables from YAML
or JSON files by specifying a list of files (relative to the context file)
under the `import` key.
This adds functionality to specify default values directly in resource sets.
The idea is that users can create a file called `values.yaml` or `values.json`
in a resource set's folder and have all variables specified in that file be
automatically merged into the resource set variables with the lowest priority.
This fixes#25
This fixes#30 (to a degree)
Users of kontemplate may expect variables defined on the parent resource to be
inherited by children.
This implements that functionality. Values defined twice are overwritten by the
child's definition.
Fixes#20