Commit Graph

58 Commits

Author SHA1 Message Date
Josh Soref 2bf8fdf45d
chore: Spelling (#9410)
* spelling: annotate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: asserts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: behavior

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: binary

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contain

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: copied

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: depending

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: deprecated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: doesn't

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: donot

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: inputting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: iteration

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: jabberwocky

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: kubernetes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: length

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mismatch

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: outputs

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: panicking

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: plugins

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: parsing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: porthos

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: regular

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: resource

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repositories

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: something

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: strict

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: string

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unknown

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-15 21:11:57 -04:00
Matt Butcher bb47286f09
fix linting error with lookup function (#7969)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-04-22 10:09:34 -06:00
Andre Sencioles d0726e07ab
Parse reference templates in predictable order (#7702)
* Parse reference templates in predictable order

Fix issue #7701

Signed-off-by: Andre Sencioles <asenci@gmail.com>

* Add test case for issue #7701 regression

Signed-off-by: Andre Sencioles <asenci@gmail.com>

* gofmt

Signed-off-by: Andre Sencioles <asenci@gmail.com>
2020-04-21 13:16:55 -06:00
Daniel Cheng 206d4a9053 add test for template recursion
Signed-off-by: Daniel Cheng <dcheng@us.ibm.com>
2020-02-10 12:25:41 -05:00
海的澜色 750b870aed fix stack overflow error (#7114)
* fixed #7111

Signed-off-by: zwwhdls <zwwhdls@hotmail.com>

* update error message

Signed-off-by: zwwhdls <zwwhdls@hotmail.com>

* add test case

Signed-off-by: zwwhdls <zwwhdls@hotmail.com>

* fix lint error

Signed-off-by: zwwhdls <zwwhdls@hotmail.com>
2019-12-02 14:57:51 +00:00
Matt Farina 9bc7934f35
Updating the module for v3 as the major version
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-10-03 14:27:05 -04:00
Ian Howell 31b940a61d fix(engine): Fix eating too many colons during template execution
This fixes #6044, in which error parsing is greedily eating too many
colons, preventing users from using colons in their warning messages to
the `required` function

Signed-off-by: Ian Howell <ian.howell0@gmail.com>
2019-07-23 11:33:03 -05:00
Thomas O'Donnell 213f714604 Stop Lint from breaking when using required
Have updated the required filter so that it doesn't break when linting a
chart. This work is based off #4221 and #4748 which didn't make it into
the v3 branch.

Signed-off-by: Thomas O'Donnell <andy.tom@gmail.com>
2019-06-13 20:32:37 +02:00
Ian Howell 278594fb0f fix(pkg/engine): Style changes on template errors
Signed-off-by: Ian Howell <ian.howell0@gmail.com>
2019-04-09 12:34:13 -05:00
Ian Howell 33b1ede570 fix(pkg/engine): Clean up template error messages
Signed-off-by: Ian Howell <ian.howell0@gmail.com>
2019-04-08 16:48:21 -05:00
Adam Reese 895e9192d4
feat(*): use vanity import helm.sh/helm
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-13 13:43:47 -07:00
Adam Reese 849f27d11f
ref(pkg/engine): make template specific functions private
Make template specific functions private to ensure they not misused and
make unit tests simpler.  We may export the template helpers later if
needed.

This lays the foundation for the new chart pipeline.

Signed-off-by: Adam Reese <adam@reese.io>
2019-03-06 15:45:52 -08:00
Adam Reese d841a1b1d9
fix(engine): make template rendering thread safe
See https://github.com/helm/helm/pull/4828

Signed-off-by: Adam Reese <adam@reese.io>
2019-03-05 12:56:39 -08:00
Adam Reese 2b81eea1e2
ref(*): replace byte array with map for Release config
Signed-off-by: Adam Reese <adam@reese.io>
2018-12-04 15:57:24 -08:00
Adam Reese 516c53dae6
ref(chart): use map for chart.Values
Signed-off-by: Adam Reese <adam@reese.io>
2018-08-29 09:56:19 -07:00
Adam Reese 4f26b658d8
change copyright to "Copyright The Helm Authors" 2018-08-24 12:03:55 -07:00
Adam Reese f012940d9c
ref(*): refactor chart/chartutil
ref(chartutil): move chart loading out of chartutil into new package
    add chart loader interface to allow lazy loading
feat(chart): create chart accessors
ref(*): cleanup requirements
ref(tiller): remove optional template engines
ref(tiller): simplify sorting releases and hooks
ref(*): code simplification
ref(hapi): move chart package out of hapi
ref(chart): add requirements and lock to Chart struct
2018-08-24 11:28:29 -07:00
Adam Reese 4c95185164
ref(*): replace chart.config with []byte 2018-04-20 00:13:19 -07:00
Adam Reese 36536d77ba
ref(*): remove protobuf any type 2018-04-18 16:28:50 -07:00
Adam Reese 6345f04190
ref(hapi): convert protobuf to go types 2018-04-18 14:53:38 -07:00
Lukas Eichler 8bc7dede18
fix(helm): Apply PR comments for tpl template name fix
Modified existing unit test to verify the changed behavior.
Removed debug print.
2017-12-03 17:39:51 +01:00
Lukas Eichler 39db9ec6e8 Merge branch 'master' into master 2017-06-08 18:40:34 +02:00
Lukas Eichler 439f1b31d1 Added unit test for include in tpl function 2017-05-28 10:55:15 +02:00
Matt Butcher 8937c775a9
fix(2452): sort templates before parse
This sorts templates by depth before sending them to the template
parser. Deepest templates are parsed first, with umbrella templates
parsed last. Since template definition names are LIFO, that means that
the highest level templates will claim the namespace.

Or, to put it simply, you can predictably override a child's defined
template by re-defining it in a parent chart.

Closes #2452
2017-05-26 18:01:49 -06:00
Lukas Eichler 2521c526d9 - Changed error behaviour to returning an error instead of writing the error in the template
- Added tests for using a function inside a template that is evaluated using the "tpl" function
2017-05-02 09:44:26 +02:00
Lukas Eichler d01f7978d2 Added implementation for a tpl function that evaluates a string as a template.
Implementation for #1978
2017-05-02 09:44:26 +02:00
Steve Wilkerson 79a3db0a63 feat(helm): add support for required properties
Adds the `required` function in enginge.go to support required
properties in values.yml. When a chart developer wishes to specify
intent in requiring a value, they can use this function to declare
an error message that gets returned when chart rendering fails
when a required value is not present in values.yml.

Closes #1580
2017-03-08 12:49:23 -06:00
Jack Zampolin fc60d51be9 Add toToml function 2017-03-01 10:19:21 -08:00
Matt Butcher d8540d78f1
feat(tiller): add fromYaml to template functions
This adds a fromYaml template function.

Closes #1604
2016-12-14 16:47:25 -07:00
Andrew Stuart 9771973888
Add AsSecrets, AsConfig methods for Files object. Move ToYaml to chartutil 2016-12-09 12:53:53 -07:00
Adnan Abdulhussein f97dbe33da fix(tests): prefix template names with "templates/" 2016-10-21 16:12:41 -07:00
Matt Butcher 36f7eb0b2a fix(linter): add engine.FuncMap so linter can use real function list
This adds a function engine.FuncMap that returns a function mapping that
better represents the functions passed to a template. The linting logic
is reconfigured to use this function instead of the sprig.FuncMap
function.

Closes #1366
2016-10-14 16:28:43 -06:00
Matt Butcher 431cc46cad feat(tiller): add toYaml template function
This adds the function toYaml to the Engine template functions.

Closes #1225
2016-09-26 14:33:54 -06:00
joe2far 72e7b22999 minor engine unit test fix 2016-08-30 17:13:34 +01:00
Matt Butcher b7945d05c4 ref(templates): change GetString to Get
This changes "pkg/chartutil".Files.Get to return a string, removes
"pkg/chartutil".Files.GetString, and adds
"pkg/chartutil".Files.GetBytes.

Closes #1020
2016-08-03 13:01:13 -06:00
Matt Butcher 9718c9e7c8 feat(engine): add 'partial' function
This adds a context-aware template function called 'partial' that will
allow rendering other templates in a chart into a string value, which
can then be piped to other functions. Usage is something like
'{{partial 'path/to/template.yaml' | indent 2}}'

This might be a bad idea.

Closes #1005
2016-08-01 16:30:34 -06:00
Matt Butcher 033dbfe75e feat(tiller): add Files map to templates
Templates can now access the non-template files in a chart by using
the '{{.Files}}' map inside of a template.

Relates to #950
2016-07-29 16:04:48 -06:00
Matt Butcher 95eeba3805 fix(tiller): merge -f values correctly
This fixes a bug in which passed-in values files were not correctly
merged into the chart's default values YAML data. I believe it also
fixes some other prioritization bugs in values merging.

The existing unit test was wrong (see TestCoalesceValues). It is
fixed now. Also added more tests to simulate issue #971.

In the course of writing this, I removed some vestigial code as
mentioned in #920.

Closes #971
Closes #920
2016-07-21 16:00:57 -06:00
Matt Butcher 73a2890277 fix(engine): change template naming
Template paths were relative to the chart that contained them, which
meant that all templates were named 'template/SOMETHING'. This made it
trivially easy to hit namespace collisions as in #933.

Template path names are essentially opaque strings so this patch simply
changes them to be qualified by parent chart.
2016-07-07 11:39:47 -06:00
Matt Butcher 532f03ec78 feat(tiller): add .Template object in templates
This allows templates to access information about the template file.
Right now, the template can only access the .Template.Name, which is the
chart-relative path to the current template.

Closes #894
2016-06-28 16:18:08 -06:00
Matt Butcher 96ac6ebc6c fix(tiller): stop printing <no value> when var is missing
Instead of printing "no value", this prints an empty string by
default, but adds a Strict flag on the engine, which (if true)
will cause a template render to error out if a value is not supplied.

Strict is set to false so that developers can instead use `default` to
set default values.
2016-06-24 16:25:43 -06:00
Matt Butcher 225d3a8adc test(engine): add test case for deep release passing 2016-06-24 12:06:52 -06:00
Matt Butcher 22ac61469f feat(*): add Values namespace to templates
This adds the .Values namespace qualifier to all values
2016-06-24 12:06:52 -06:00
Matt Butcher e757b24aed fix(*): add license header 2016-06-22 12:28:45 -06:00
Matt Butcher 60f5341b91 feat(chartutil): support global variables
This provides support for "global" variables. It does this by
declaring "global" to be a special namespace. It then copies this
namespace into every subchart, coalescing it into any "global"
namespace found there.

The net result is that if "global.foo" is set in the YAML file, it
will be available to every chart/subchart as ".global.foo" regardless of
where that chart is in the subchart tree.
2016-06-14 11:24:09 -06:00
Matt Butcher 490cef784c fix(tiller): refactor template render to use chartutil. 2016-06-13 13:11:39 -06:00
Adam Reese d95a144563 fix(chartutil): fix nil error on values
Fixes: https://github.com/kubernetes/helm/issues/803
2016-06-09 11:09:00 -07:00
Matt Butcher 9ca8c27e16 fix(*): change TOML to YAML 2016-06-06 21:12:36 -06:00
Adam Reese 818c878700 chore(*): use k8s.io as the import path 2016-06-06 17:17:04 -07:00
Matt Butcher 6db7c39b84 feat(helm, tiller): implement k8s portion of install
This commit finally ties `helm install` together with the Kubernetes
client library to make an end-to-end trip.

There were several small fixes to go on both client and server side,
along with some changes to proto to support better error reporting.

The alpine chart has been updated to exhibit how the new Helm works.
2016-05-04 17:27:00 -06:00