Commit graph

9 commits

Author SHA1 Message Date
Vincent Ambo
dd2fdd63e5 fix templater & ctx: Correctly check resource set parent 2017-02-08 17:42:06 +01:00
Vincent Ambo
756a4c745d fix templater: Guard against empty parent reference 2017-02-08 17:34:49 +01:00
Vincent Ambo
4e8223ef34 feat context: Add support for resource set collections
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 17:34:49 +01:00
Vincent Ambo
8e08a282eb feat templater: Add ability to exclude resource sets
* renamed --limit to --include (-i)
* added --exclude (-e)

Kontemplate users can now explicitly include and exclude certain resource sets.
Excludes always override includes.

Closes #11
2017-02-08 16:53:38 +01:00
Vincent Ambo
25f2a1616c feat template: Add additional template functions
This adds the Go template functions from [sprig][] as well as a custom `json`
function that can interpolate any data as a JSON object - very useful for adding
arrays of data in JSON format into a variable:

```
certificateDomains:
  - oslo.pub
  - tazj.in

annotations:
  acme/certificate: {{ .certificateDomains | json }}

annotations:
  acme/certificate: ["oslo.pub", "tazj.in"]
```

[sprig]: https://godoc.org/github.com/Masterminds/sprig
2017-02-08 14:40:45 +01:00
Vincent Ambo
3ef0f35bfe fix templater: Guard against empty values map 2017-02-08 13:47:56 +01:00
Vincent Ambo
7ac63613fb feat main: Add proper CLI support
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 12:58:53 +01:00
Vincent Ambo
8fac7c1a41 chore: Better example & gofmt 2017-02-08 11:55:59 +01:00
Vincent Ambo
9e3ee3f2bb feat templater: Add initial templating support 2017-02-08 11:50:49 +01:00