about summary refs log tree commit diff
path: root/context
AgeCommit message (Collapse)AuthorFilesLines
2018-06-21 fix(context): Use SplitN to split CLI variable specificationsVincent Ambo1-1/+1
In some cases the value of a variable may contain an equals sign, which would not work in the previous version. This uses `SplitN` to split the variable specifier into a pre-determined number (2) of sub-slices. Further `=`-symbols will then be included in the second substring.
2018-06-09 fix(context): Global values have precedence over defaultsVincent Ambo1-2/+2
2018-06-09 feat(context): Support loading import variables from absolute pathsVincent Ambo2-11/+20
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
2018-06-09 refactor(context): Implement more explicit merging of variablesVincent Ambo3-54/+95
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`.
2018-06-09 feat(context): allow explicit variables to be defined as argumentPhillip Johnsen2-0/+43
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
2018-03-09 refactor: Remove old error handling libraryVincent Ambo1-12/+5
Removes the old error handling library and switches to plain fmt.Errorf calls. There are several reasons for this: * There are no useful types or handling here anyways, so output format is the only priority. * Users don't care about getting stacktraces. * My emotional wellbeing. Fin de siècle.
2017-11-21 feat(license): Relicense under GPLv3Vincent Ambo2-0/+18
All further kontemplate source code changes and releases will happen under the GPLv3. Previous releases are still available under the MIT license.
2017-08-31 fix templater: Don't template default.yml filesVincent Ambo1-3/+1
After the change from #84 default variable files with the '.yml' extension got templated as resource set templates accidentally. This resolves the issue by moving the list reserved default file names to a common place and reusing it in both the templater and context pkg. This fixes #85
2017-08-25 fix context: Support ".yml" extension on default filesVincent Ambo1-9/+6
In other places in Kontemplate that deal with YAML files, both the ".yaml" and ".yml" extension are supported. This fixes context loading code to support that for resource set variables, too. This fixes #83
2017-08-04 style: Apply go fmtVincent Ambo1-8/+8
2017-08-04 docs context: Document ResourceSet & Context struct fieldsVincent Ambo1-2/+19
2017-07-13 feat context: Allow overriding resource set pathsVincent Ambo4-5/+105
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
2017-07-03 feat context: Add ability to import extra variables from filesVincent Ambo6-4/+96
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.
2017-07-03 refactor context: Extract loadJsonOrYaml to util packageVincent Ambo1-29/+3
The logic to deserialise a structure from *either* JSON or YAML is reused several times and can be easily extracted, which this commit does.
2017-04-04 fix test: Assert variable override orderVincent Ambo1-0/+5
2017-04-04 feat context: Support resource set default valuesVincent Ambo4-3/+65
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)
2017-02-20 style: Apply go fmtVincent Ambo1-2/+2
2017-02-14 feat ctx: Let sub-resource-sets inherit vars from parentVincent Ambo4-0/+81
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
2017-02-08 feat context: Add deserialisation testsVincent Ambo3-0/+108
2017-02-08 fix templater & ctx: Correctly check resource set parentVincent Ambo1-2/+3
2017-02-08 fix context: Set sub resource names correctlyVincent Ambo1-0/+1
2017-02-08 feat context: Add support for resource set collectionsVincent Ambo1-0/+24
A resource set collection is a resource set with an addition 'include' array configured. It is a short-hand for importing multiple resource sets from the same folder and for excluding/including them as a group. See https://github.com/tazjin/kontemplate/issues/9 for more information. Closes #9
2017-02-08 feat context: Add YAML loading supportVincent Ambo1-1/+14
Closes #5
2017-02-08 feat main: Add proper CLI supportVincent Ambo1-1/+2
Adds a basic CLI structure with a single "run" command that takes a --file (-f) and --limit (-l) flag. --limit can be used to only output certain resource sets. Closes #4
2017-02-08 feat context: Add types and loading functionsVincent Ambo1-0/+51