32 Commits
Author SHA1 Message Date
Oleg Sidorov 4cddc82c0b Reverted changes introduced in #6010
This commit reverts changes introduced in #6010 due to a massive
regression reported in #6708. An attempt to fix the problem in
https://github.com/helm/helm/pull/6709 seems to be unreasonably clumzy
and hacky, therefore reverting the offensive change seems to be the most
pragmatic solution.

This reverts commits:
  * 70cd32c4ce.
  * 9014bd9c50.

Signed-off-by: Oleg Sidorov <me@whitebox.io>
2019-10-22 22:26:38 +02:00
Adam Eijdenberg f8f8b5d076 Add test for subchart with null value (#6146)
Signed-off-by: Adam Eijdenberg <adam@continusec.com>
2019-08-23 17:22:54 +01:00
Stefan Deitmer e53613db3f Fix subchart values not being deleted by setting value to nil in parent chart's values
Signed-off-by: Stefan Deitmer <stefan.deitmer@gec.io>
2019-07-25 14:29:45 +02:00
Oleg Sidorov 9014bd9c50 chartutil.ReadValues is forced to unmarshal numbers into json.Number
This change is an attempt to address the common problem of json number
unmarshalling where any number is converted into a float64 and
represented in a scientific notation on a marshall call. This behavior
breaks things like: chart versions and image tags if not converted to
yaml strings explicitly.

An example of this behavior: k8s failure to fetch an image tagged with a
big number like: $IMAGE:20190612073634 after a few steps of yaml
re-rendering turns into: $IMAGE:2.0190612073634e+13.

Example issue: https://github.com/helm/helm/issues/1707

This commit forces yaml parser to use JSON modifiers and explicitly
enables interface{} unmarshalling instead of float64. The change
introduced might be breaking so should be processed with an extra care.

Due to the fact helm mostly dals with human-produced data (charts), we
have a decent level of confidence this change looses no functionality
helm users rely upon (the scientific notation).

Relevant doc: https://golang.org/pkg/encoding/json/#Decoder.UseNumber

Signed-off-by: Oleg Sidorov <oleg.sidorov@booking.com>
2019-07-11 15:12:02 +02:00
Adam Eijdenberg 29a295eb84 Add test for existing merging behaviour of mixed types
Signed-off-by: Adam Eijdenberg <adam.eijdenberg@digital.gov.au>
2019-06-12 10:06:50 +10:00
Adam Eijdenberg 5b9311d163 Fix nested null value overrides
- Add ability to test for nested non-existent keys
- Add test cases for nested null values
- Minimalist fix for nested null key test cases
- Add missing metadata to integration test

Signed-off-by: Adam Eijdenberg <adam.eijdenberg@digital.gov.au>
2019-05-31 16:23:54 +10:00
Martin Hickey 58be8e461c Update messaging in value parsing to improve traceability (#4974)
Closes #4736

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2018-11-30 10:04:37 -08:00
Morten Torkildsen 82d01cb312 fix(helm): Merge nested values correctly on upgrade (#4806)
Upgrading a release and override existing values doesn't work as expected for nested values. Maps should be merged recursively, but currently maps are treated just like values and replaced at the top level.

If the existing values are:
```yaml
resources:
  requests:
    cpu: 400m
  something: else
```
and an update is done with ```--set=resources.requests.cpu=500m```, it currently ends up as
```yaml
resources:
  requests:
    cpu: 500m
```
but it should have been
```yaml
resources:
  requests:
    cpu: 500m
  something: else
```

This PR updates the way override values are merged into the existing set of values to merge rather than replace maps.

Closes: #4792

Signed-off-by: Morten Torkildsen <mortent@google.com>
2018-11-12 12:32:21 +01:00
Matthew Fisher 2d77db11fa change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
Steven E. Harris e8d80729ac Merge pull request #2703 from rbwsam/ref/simplify_error
ref(pkg/chartutil): replace use of 'fmt.Efforf'
2017-07-25 10:14:32 -04:00
Sam Leavens cf09e344d1 fix(pkg/chartutil): Fix test, improve message
Fix inverted equaility check and update error message.
2017-07-20 13:19:48 -07:00
Sam Leavens 8df52b6501 ref(pkg/chartutil): move comment
Move comment out of test. Move ref location in test.
2017-07-20 13:10:59 -07:00
Sam Leavens 3ee70291c8 ref(pkg/chartutil): Capitalize YAML
Capitalize "yaml" in error message. Remove empty var from test error message.
2017-07-20 11:52:49 -07:00
Sam Leavens 51b59497ee ref(pkg/chartutil): decrease map lookups
Decrease map lookups in `chartutil.coalesceValues` and move comment to unit
test.

Closes #2663
2017-07-19 17:55:11 -07:00
Sam Leavens 9b8928edf4 ref(pkg/chartutil): replace use of 'fmt.Efforf'
'fmt.Errorf' is unnecessary when checking for 0 length path in Values.PathValue
due to the lack of formatting. Add test covering changes.
2017-07-19 15:53:12 -07:00
Scott Rigby 6dc31f8e96 Test that the coalesced key is properly removed for all YAML null syntax options, but not for empty string 2017-07-07 14:32:56 -04:00
Adam Reese 85c41ef11a ref(*): kubernetes v1.6
Rebase on kubernetes v1.6
2017-04-11 15:42:23 -07:00
Justin Scott 8ef733ca7d feat(helm): add conditions and tags
This feature adds the ability to selectively control the loading of charts using entries in top chart's values.
When 'helm install --set tags.mytag=true', charts with that tag will be enabled unless disabled in parent by condition.
When 'helm install --set mychart.enabled=true', charts with that yaml path specified will be enabled.

Closes #1837
2017-02-11 12:56:43 -08:00
Matt Butcher cb0a6c7e07 feat(tiller): add {{.Capabilities}} object
This adds the {{.Capabilities}} object to the template variables so that
chart authors can write charts that are aware of teh Kubernetes
capabilities of the current cluster.

Closes #1608
2017-01-09 18:09:20 -07:00
Matt Butcher b3d812b346 Merge pull request #1692 from technosophos/fix/allow-global-map-merges
fix(tller): allow deep merge of global maps
2016-12-16 16:29:13 -07:00
Matt Butcher 6faf4675ac fix(tller): allow deep merge of global maps
This reverts a previous decision to only do shallow merges of globals.
It allows globals to be nested maps.
2016-12-15 17:06:30 -07:00
Matt Butcher b2d762af48 feat(tiller): add .Release.IsInstall 2016-12-15 15:04:36 -07:00
Matt Butcher de7c5e5a38 feat(tiller): Add .Release.Revision and .IsUpgrade
New properties are available to template developers.

Closes #1554
2016-12-14 18:06:34 -07:00
Adam Reese f71230ccd3 fix(*): resolve go linter issues 2016-10-10 14:58:33 -07:00
vaikas-google 6d26024a27 first cut of version on client and server 2016-09-12 20:56:17 -07: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
Adnan Abdulhussein 4ef61a7136 fix(chartutil): Ensure ReadValues doesn't return a nil map 2016-06-29 15:38:53 -07: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 e8109048a9 fix(chartutil): move values coalescing into chartutil 2016-06-09 14:10:12 -06:00
Matt Butcher 7aa4ffa4d4 feat(chartutil): switch TOML to YAML 2016-06-06 21:09:27 -06:00