Commit graph

253 commits

Author SHA1 Message Date
Adam Reese
1779ad5302
ref(cmd/helm): remove init command
Signed-off-by: Adam Reese <adam@reese.io>
2019-08-26 10:21:52 -07:00
Adam Reese
b6fdd8783b
feat(cmd/helm): remove need for helm init command
* allow repository config via cli
* make `helm repo add` create repo config file if it does not exist
* squash a ton of bugs

Signed-off-by: Adam Reese <adam@reese.io>
2019-08-22 23:31:50 -07:00
Matthew Fisher
d99edbfb3e
fix(chartutil): remove executable bits from chartutil generated files
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-08-13 16:31:08 -07:00
Taylor Thomas
c9c95ea148 ref(*): Moves packages to internal
These packages are generally used only for logic inside of Helm and
can later be re-exported as needed

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-08-09 16:02:33 -06:00
Josh Dolitsky
cc5dece910
fix(chartutil): Ensure nested template dir on save (#6177)
If a templates/ dir of a chart contained a subdirectory,
for example "templates/tests/test-db.yaml", an error was
being thrown on export due to missing the "templates/test"
directory prior to saving the template file itself.

Fixes #5757

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
2019-08-08 11:32:03 -05:00
Martin Hickey
149da7c77e Update scaffold chart to v2 apiVersion
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-07-29 19:02:59 +01:00
Martin Hickey
7ddd3f482e
Merge pull request #6038 from liuliqiang/dev-v3
Fix paths in the ingress template and values file written by helm create
2019-07-23 14:44:37 +01:00
Liu Liqiang
49120340d3 Fix paths in the ingress template and values file written by helm create
Signed-off-by: Liu Liqiang <liuliqiang@smartx.com>
2019-07-23 17:25:47 +08:00
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
Oleg Sidorov
ec440d446d Replaced ghodss/yaml with sigs.k8s.io/yaml
This commit replaces usage of github.com/ghodss/yaml with it's forked
version maintained by SIG community. The replaced library has
low-to-none support activity unlike the latter. We believe the new
Helm branch could benefit from using the community-supported version on
a long-term run as yaml parser is a key component of Helm chart rendering
engine.

This commit locks sigs.k8s.io/yaml dependency version on 1.1.0 which
is backwards compatible with ghodss/yaml 1.0.0.

This change also resolves the outdated dependency version lock for
ghodss/yaml (currently 1.0.0) and makes it possible to port changes from
https://github.com/helm/helm/pull/6010 to dev-v3.

Signed-off-by: Oleg Sidorov <oleg.sidorov@booking.com>
2019-07-12 16:52:15 +02:00
Matt Farina
379b2b177c
Updating to the new Ingress group version
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-06-17 12:10:34 -04:00
Adam Reese
b49db9e6e6
ref(pkg/chartutil): break up chartutil into logical files
Signed-off-by: Adam Reese <adam@reese.io>
2019-05-22 19:38:11 +02:00
Adam Reese
45f63628e1
ref(pkg/chart): remove unused chart.RawValues
Signed-off-by: Adam Reese <adam@reese.io>
2019-05-16 11:03:21 -07:00
Adam Reese
590bf10ab5
fix(pkg/action): add namespace to release options
ref: https://github.com/helm/helm/issues/5732

Signed-off-by: Adam Reese <adam@reese.io>
2019-05-15 14:08:51 -07:00
Matthew Fisher
757eb88d6c
Merge pull request #5441 from hickeyma/update-lib-charts
feat(*): Add capability for application charts to be used as library charts
2019-05-14 13:58:44 -07: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
Martin Hickey
ecf4eda6c5 Fix scaffold chart label in helper template
The 'app.kubernetes.io/version' label was not being rendered as
expected. It was appending onto the label before it and also
the next label label was appending onto it on the same line.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-05-09 10:56:46 +01: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
Luis Davim
82ffe56ca6
Reduce template code duplication. Fixes #5372
Signed-off-by: Luis Davim <luis.davim@jet.com>
2019-05-07 12:03:54 -04:00
Luis Davim
4425f86865
Add app.kubernetes.io/version label
Signed-off-by: Luis Davim <luis.davim@jet.com>
2019-05-07 11:59:49 -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
Martin Hickey
f12c2a3111 Change the nginx app version to a set tag
Want to avoid moving tags like using 'stable'. Therefore,
specify the specifc nginx version/tag.

Update from comment review:
- https://github.com/helm/helm/pull/5662#discussion_r280122531

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-05-02 10:00:41 +01:00
Martin Hickey
0b809dd078 Validate library chart files after chart loaded
Validate the library chart files after the chart and
its depoendencies have been loaded. This is an update
following review comment:
- https://github.com/helm/helm/pull/5441#pullrequestreview-231339425

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-05-01 14:56:32 +01:00
Martin Hickey
86c5e52ac4 Fix the image field for the scaffold chart application
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-04-30 18:13:17 +01: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
Matthew Fisher
d3f0ac9343
ref(create): app version should be 0.1.0
When creating a Helm chart for the first time, the assumption should be that the app version is also 0.1.0, implying this is for a new application.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-04-15 12:06:16 -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
31819e4796
fix(pkg/chartutil): marshal capabilities VersionSet into slice
Marshal capabilities VersionSet into readable value.

Signed-off-by: Adam Reese <adam@reese.io>
2019-03-29 08:49:15 -07:00
Adam Reese
87e789f01f
fix(pkg/chartutil): only include external objects in capabilities
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-28 23:37:32 -07:00
Adam Reese
295092cd7d
ref(pkg/action): refactoring dup code and linter fixes
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-26 11:11:27 -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
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
Martin Hickey
ef4d2a6e65 Update after review
Review comment:
- https://github.com/helm/helm/pull/5295#pullrequestreview-203519813

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-02-15 11:28:39 +00: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
d94707db86
ref(*): remove helmVersion chart constraint
* Remove helmVersion constraint from charts
* Guard compile time set variables behind `internal/`
* Allow configuration of UserAgent for HTTPGetter

Signed-off-by: Adam Reese <adam@reese.io>
2019-01-08 13:37:55 -08:00
Matt Butcher
f3bfae5ea7
fix: fix a number of style errors (#5136)
This fixes a dozen or so style errors, almost all of which were just missing comments.

I left several which are fixed in other outstanding PRs, or which belong to code that is about to be removed.

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2019-01-07 21:40:24 -07: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
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
825b15c763
Merge pull request #4972 from adamreese/ref/chart-dependencies
ref(pkg/chart): rename Requirements to Dependencies
2018-11-28 10:55:08 -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
roc
79f88dfc5e ref(url) update helm's github url (#4962)
https://github.com/kubernetes/helm -> https://github.com/helm/helm
https://github.com/kubernetes/charts -> https://github.com/helm/charts

Signed-off-by: Roc Chan <roc@imroc.io>
2018-11-28 10:08:38 -08:00
Adam Reese
9e1e26f01e
ref(pkg/chartutil): attempt to make requirements processing readable
Signed-off-by: Adam Reese <adam@reese.io>
2018-11-14 12:41:14 -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
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
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