Commit graph

52 commits

Author SHA1 Message Date
Matthew Fisher
4f6d002d6c
chore(docs): move docs to helm-www
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-07-22 12:15:35 -07:00
Oleg Sidorov
f94bac0643 chartutil.ReadValues is forced to unmarshal numbers into json.Number refs #1707 [dev-v3]
Backport of https://github.com/helm/helm/pull/6010 to dev-v3 (the
description below is a copy-paste from the original v2 branch PR).
As https://github.com/helm/helm/pull/6016 is now merged to dev-v3, the
change is reasonably trivial.

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: #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>
Signed-off-by: Oleg Sidorov <me@whitebox.io>
2019-07-17 10:30:51 +02:00
Adam Reese
b7a14de590
Merge pull request #5601 from adamreese/v3/capabilities
ref(pkg/chartutil): remove k8s version object dependency
2019-05-09 14:29:34 -07:00
Adam Reese
097834de0a
ref(pkg/chartutil): remove k8s version object dependency
Flattens the `.Capabilities` built-in and removes useless kubernetes
runtime metadata.

Signed-off-by: Adam Reese <adam@reese.io>
2019-05-07 13:49:05 -07:00
Matt Farina
250b63eced
Updating the labels for consistency
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-05-07 14:13:29 -04:00
Matt Farina
af7eab0325
Updating to the k8s label convention
Closes #4335

Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-05-07 11:26:31 -04:00
Ian Howell
ffff0e8c33 Feat/schema validation (#5350)
* Add the Schema type and a function to read it

* Added a function to read a schema from a file

* Check that values.yaml matches schema

This commit uses the gojsonschema package to validate a values.yaml file
against a corresponding values.schema.yaml file.

* Add functionality to generate a schema from a values.yaml

* Add Schema to Chart and loader

* Clean up implementation in chartutil

* Add tests for helm install with schema

* Add schema validation to helm lint

* Clean up "matchSchema"

* Modify error output

* Add documentation

* Fix a linter issue

* Fix a test that broke during a rebase

* Clean up documentation

* Specify JSONSchema spec

Since JSONSchema is still in a draft state as of this commit, we need to
specify a particular version of the JSONSchema spec

* Switch to using builtin functionality for file extensions

* Switch to using a third-party library for JSON conversion

* Use the constants from the gojsonschema package

* Updates to unit tests

* Minor change to avoid string cast

* Remove JSON Schema generation

* Change Schema type from map[string]interface{} to []byte

* Convert all Schema YAML to JSON

* Fix some tests that were broken by a rebase

* Fix up YAML/JSON conversions

* This checks subcharts for schema validation

The final coalesced values for a given chart will be validated against
that chart's schema, as well as any dependent subchart's schema

* Add unit tests for ValidateAgainstSchema

* Remove nonessential test files

* Remove a misleading unit test

The TestReadSchema unit test was simply testing the ReadValues function,
which is already being validated in the TestReadValues unit test

* Update documentation to reflect changes to subchart schemas
2019-04-26 08:45:03 -07:00
Adam Reese
e458a67f0c
ref(pkg/chart): add validation method to chart
Consolidate validation of Chart.yaml.

Signed-off-by: Adam Reese <adam@reese.io>
2019-04-05 13:40:06 -07: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
Matthew Fisher
95c865513f
fix appveyor builds (#4934)
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-01-31 21:31:09 -08:00
Adam Reese
6fc8c9e079
ref(pkg/chartutil): simplify chart dependency unit tests
- simplify unit tests
- refactor typed errors
- unexport internal functions

Signed-off-by: Adam Reese <adam@reese.io>
2018-11-29 10:30:52 -08:00
Adam Reese
85aef0d3d7
ref(pkg/chart): rename Requirements to Dependencies
Signed-off-by: Adam Reese <adam@reese.io>
2018-11-28 10:20:33 -08:00
Adam Reese
21259507bd
ref(*): rename requirements.lock to Chart.lock
Signed-off-by: Adam Reese <adam@reese.io>
2018-08-29 14:43:37 -07:00
Adam Reese
f7a7a157ce
ref(*): merge requirement.yaml into Chart.yaml
Signed-off-by: Adam Reese <adam@reese.io>
2018-08-29 14:05:37 -07:00
Adam Reese
aa859e3f88
feat(*): remove Time, Namespace, and Revision from template functions
Removes Time, Namespace, and Revision from being exposed to templates to
make template rendering discrete and repeatable.
2018-05-18 12:09:54 -07:00
Matthew Fisher
14c7be1f92
Merge pull request #3288 from bradbeam/starter
feat Making starter templates more versatile
2018-01-19 11:14:21 -08:00
Matt Farina
d5a865b5f4
fix(capabilities): Adding GitVersion to default set
Prior to this, using the semver template functions with the full
version, which is represented in the GitVersion, was not possible
for helm template and lint commands because the property was not
populated by default. This update adds default handling.

Closes #3349
2018-01-16 13:02:30 -05:00
Brad Beam
8e0eface2c Making starter templates more versatile
This adds support for changing '<CHARTNAME>'
occurances in starter chart to the destination
chart name
2018-01-01 04:34:38 +00:00
Johnny Bergström
7cc610960f Walk symbolic link directories
Continue walking symlinks to be able to use them
for sub-charts. Useful when not specifying requirements
but still want to share charts locally.
2017-11-23 11:41:09 +01:00
Johnny Bergström
d762a42168 Fix helmignore for .* (#3114)
When the first rule matching entry for top level dir
will be empty string, the .* rule will match.
Skip this entry as it's not needed for processing.
2017-11-22 09:20:41 -07:00
Kazuki Suda
fa3ee5aecf feat(helm): add --kube-version flag to helm template
This commit adds --kube-version flag to helm template. It allows you to
override the Kubernetes version used as Capabilities.KubeVersion.Major/Minor (e.g. 1.7).
2017-09-11 11:22:00 +09:00
Justin Scott
4a02a71f1e WIP feat(helm): add template command
This adds the functionality from the helm-template plugin to allow the
rendering of templates without Tiller.

Closes #2755
2017-08-28 18:04:56 -07:00
Kira
4c1a47480e feat(2450): add annotations to chart metadata (#2671)
* feat(2450): add options to chart metadata
2017-08-16 18:27:13 -04: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
Sushil Kumar
82da721c0a Added tests for different combinations of subcharts & requirements.yaml
Added more tests to test following comibnations of subcharts and requirements.yaml
- [ ] subcharts not specified in requirements.yaml
- [ ] some subcharts specified in requirements.yaml while others should be picked directly from "charts\"
- [ ] all subcharts specified in requirements.yaml without alias
- [ ] subcharts specified in requirements.yaml with alias is already tested
2017-06-22 10:44:20 -07:00
Sushil Kumar
716be14ad3 Updated code to read requirements.yaml as per following structure
```
- name: <dependency-chart-name>
  alias: <alias-name-to-be-used>
  version: <dependency-chart-version>
  repository: <dependency-chart-version>
```
2017-06-05 14:35:44 -07:00
Sushil Kumar
42aa81e7ca Added tests for alias(es) for chart dependencies 2017-05-25 14:18:32 -07:00
Justin Scott
75ea566413 Correct indention of YAML field in subchartB 2017-03-31 10:46:50 -07:00
Justin Scott
3bf143f052 Fix codefences and nits in charts.md. Correct whitespace in charts. Add clarity to description of ImportValues requirements field. 2017-03-31 10:19:08 -07:00
Justin Scott
7ea4d8c7c4 Refactor so parent's values win 2017-03-31 10:19:08 -07:00
Justin Scott
007bb9dbae Implement 'exports' convetion for simple list items 2017-03-31 10:19:08 -07:00
Justin Scott
0e81899f5f WIP feat(helm): import child values to parent
Implements a mechanism in requirements.yaml to allow the import
and re-parenting of value table from child chart.

Closes #1995
2017-03-31 10:19:08 -07:00
Justin Scott
58c8aca1cc feat(helm): fixup if/ele,remove extra string casts, add comments 2017-02-11 12:56:43 -08:00
Justin Scott
004c5bcc88 feat(helm): fix condition when no requirements.yaml exists during tag/condition processing 2017-02-11 12:56:43 -08: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
7f4ea91028 Merge pull request #1645 from rodcloutier/Windows_archive_backslash_support
fix(helm): added support for compressed charts containing \ in file paths
2016-12-14 18:13:58 -06:00
Adam Reese
0c6b6d1c62 fix(*): correct file permissions on source files 2016-12-07 09:09:38 -08:00
Rodrigue Cloutier
37920761a4 fix(helm): added support for compressed charts containing \ in file paths 2016-12-06 09:13:40 -05:00
Matt Butcher
2388e71528 fix(helm): ignore dotfiles in charts/ directories
This causes 'helm dep [up|install]' to ignore files in charts/ that
start with either a dot or an underscore. It also changes the
chartloader to ignore those files.

Also, if a 'helm dep up' does not find a charts/ directory, it creates
one.

Closes #1342
2016-10-11 18:59:45 -06:00
Matt Butcher
e0227c7510 fix(chart): Chart.yaml now has an apiVersion field.
This is to future-proof charts, and also be consistent with repo and
index YAML files.

Closes #1264
2016-10-04 12:18:22 -06:00
Matt Butcher
68dd4c9a66 fix(proto): remove unused fields
Some fields were introduced to Chart metadata after Alpha.4, but are not
going to be used ever. So we made the decision to remove them before we
get stuck with ugliness.

This should not break compatibility, since these fields were not used.
2016-09-28 16:22:41 -06:00
Matt Butcher
593718d749 feat(helm): add 'helm dependency' commands
This also refactors significant portions of the CLI, moving much of the
shared code into a library.

Also in this release, a testing repository server has been added.
2016-09-23 16:24:22 -06:00
Matt Butcher
a5921faf99 feat(chartutils): add support for requirements.yaml 2016-09-23 14:57:56 -06:00
Matt Butcher
34577d1ebc feat(charts): add 'dependencies:' to Chart.yaml
This feature adds a dependencies section to a chart file. It is a
prerequisite for adding automated chart management tooling as described
in #874.
2016-09-06 17:34:54 -06:00
Matt Butcher
a46a033de4 feat(chart): support 'image:URL' in charts.
Closes #1034
2016-08-22 16:05:40 -06:00
Matt Butcher
2e95230b30 fix(helm): fix helmignore evaluation of dirs
This adds a few extra settings to the default .helmignore file. In
doing this, I found a bug that some directory patterns are not
evaluated correctly. Fixed that and added tests.

Closes #989
Closes #1027
2016-08-05 15:50:02 -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
9ca8c27e16 fix(*): change TOML to YAML 2016-06-06 21:12:36 -06:00
Matt Butcher
7aa4ffa4d4 feat(chartutil): switch TOML to YAML 2016-06-06 21:09:27 -06:00