Commit graph

283 commits

Author SHA1 Message Date
Matthew Fisher
402fce389a
fix(chartutil): restore .Release.Revision
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-17 11:04:45 -07:00
Karuppiah Natarajan
dfed8ab5e3
fix install storing computed values in release
this was partially fixed in #6430 but the fix only
worked for values without nesting. this PR fixes it.
this is done by doing a deep copy of values rather
than a top level keys copy. deep copy ensures
values are not mutated during coalesce()
execution which leads to bugs like #6659

the deep copy code has been copied from:

https://gist.github.com/soroushjp/0ec92102641ddfc3ad5515ca76405f4d

which is in turn inspired by this stackoverflow answer:
http://stackoverflow.com/a/28579297/1366283

Signed-off-by: Karuppiah Natarajan <karuppiah7890@gmail.com>
2019-10-17 16:37:19 +05:30
Ken Perkins
060def3b88 Fix chartutils/errors.go stack overflow
- Changes to use a struct with string property
- Changes references in chartutil/values.go

Signed-off-by: Ken Perkins <ken.perkins@rackspace.com>
2019-10-15 15:03:36 -07:00
Ken Perkins
01ea487582 Introducing an tests for chartutils/errors.go
- Should panic on string recursion error

Signed-off-by: Ken Perkins <ken.perkins@rackspace.com>
2019-10-15 13:14:03 -07:00
Taylor Thomas
da72944611
Merge pull request #6640 from thomastaylor312/feat/parse_pre_release
feat(lint): Ports v2 functionality for linting pre-release charts
2019-10-11 10:42:48 -06:00
Matthew Fisher
0f26eeb8fd
Merge pull request #6519 from SimonAlling/dev-v3
fix(pkg/chartutil): include values.schema.json in packaged chart
2019-10-11 09:02:01 -07:00
Martin Hickey
dd1a440026
Add support to scaffold chart for ingress prior to k8s 1.14 (#6651)
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-10-11 15:33:30 +01:00
Simon Alling
2a462aef2d fix(pkg/chartutil): add tests according to feedback
The seemingly redundant `return filename, err` line is related to how
the name `err` is used throughout the function: there is a "global" (to
the function) `err` variable, as well as several locally block-scoped
ones. It took me hours to understand why my code did not work without
that line, but I decided not to clean up the `err` code in this commit.

Signed-off-by: Simon Alling <alling.simon@gmail.com>
2019-10-11 10:49:43 +02:00
Taylor Thomas
0ba959af0d feat(lint): Ports v2 functionality for linting pre-release charts
This is a port of #5177

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-10 16:58:47 -06:00
Simon Alling
50675e7cd7 fix(pkg/chartutil): include values.schema.json in packaged chart
Before this commit:

    $ helm lint my-chart            # Finds errors in values.yaml
    $ helm package my-chart
    $ helm lint my-chart-1.0.0.tgz  # Does not find errors in values.yaml

Signed-off-by: Simon Alling <alling.simon@gmail.com>

Co-authored-by: Andreas Lindhé <andreas@lindhe.io>
2019-10-10 20:56:06 +02:00
Marc Khouzam
adbc39beb5 Remove impossible condition reported by linter
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2019-10-09 23:18:03 -04:00
Matthew Fisher
7ffc879f13
Merge pull request #6607 from thomastaylor312/fix/missing_path_validation
fix(chart): Ports security fix for invalid paths in tarballs
2019-10-08 10:04:32 -07:00
Taylor Thomas
62ed7b3764
Merge pull request #6594 from thomastaylor312/feat/template_api_versions
feat(template): Ports api-versions flag to v3
2019-10-08 10:18:07 -06:00
Taylor Thomas
3637996dcd fix(chart): Ports security fix for invalid paths in tarballs
This is a port of #5165 and the small refactor in #5610. This is the issue
where carefully crafted paths can reach outside of the intended chart directory

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-08 10:13:43 -06:00
wxdao
c00890cae1 Fix Save misbehavior on nonexistent directory (#6360)
Signed-off-by: wxdao <waxiadao@gmail.com>
2019-10-08 14:23:14 +01:00
Taylor Thomas
59d3488d1c feat(template): Ports api-versions flag to v3
This is a port of #5392. It also takes care of the small chore to update the default k8s
version to 1.16, which is the latest supported version

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-07 13:30:06 -06:00
Martin Hickey
335d27a976
Fix ingress API group in scaffold chart (#6591)
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-10-07 15:46:02 +01:00
Matthew Fisher
9510713d21
fix(chartutil): port over enhancements to helm create from Helm 2
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-03 12:34:58 -07: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
Matt Farina
967f4fed42
Update dependencies
* Kubernetes updated to 1.16.1
* SemVer and Sprig updated to latest releases that leverage go
  modules
* Tests and checks updated. These already landed in v2 via PR 6457

Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-10-03 13:49:07 -04:00
Taylor Thomas
319045d351
Merge pull request #6547 from SimonAlling/processDependencyConditions
ref(pkg/chartutil): Simplify processDependencyConditions
2019-10-02 14:26:10 -06:00
Simon Alling
43bb10cd24 ref(pkg/chartutil): Dry up file and path names (#6554)
Signed-off-by: Simon Alling <alling.simon@gmail.com>
2019-10-02 09:36:14 +01:00
Simon Alling
a40debd42b ref(pkg/chartutil): Simplify processDependencyConditions
Before this commit, `r.Enabled` was modified if and only if a boolean
was found in the for loop, and in that case, it was assigned the value
of said boolean, just in a more complicated way.

Signed-off-by: Simon Alling <alling.simon@gmail.com>
2019-10-01 18:38:38 +02:00
Matthew Fisher
37f7cc0851
Merge pull request #4917 from derkoe/dev-v3-fix-requirement-condition
fix(pkg/chartutil): conditions for alias and umrella charts (#3734)
2019-09-30 14:50:19 -07:00
Martin Hickey
db15a6f898
Create charts directory for scaffold chart (#6516)
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-09-30 16:37:34 +01:00
Taylor Thomas
d95a6246a4
Merge pull request #6430 from karuppiah7890/fix-install-storing-computed-values
fix install storing computed values in release instead of user supplied values
2019-09-23 11:49:03 -06:00
Cindy O'Neill
41e9359716 handle ingress apiVersion change for kubernete versions
Signed-off-by: Cindy O'Neill <cubiedoo2@gmail.com>
2019-09-18 11:11:34 -06:00
Reinhard Nägele
38e41e12c9 ref(*): Improve and fix scaffold chart and API versions (#6426)
* Use `apps/v1` for Deployment
* Reformat comments
* Consistently use `nindent` and indent properly
* Introduce named template for selector labels
* Fix label selector in `NOTES.txt`

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
2019-09-18 12:24:03 +01:00
Karuppiah Natarajan
25324ca8db
fix install storing computed values in release instead of user supplied values
Signed-off-by: Karuppiah Natarajan <karuppiah7890@gmail.com>
2019-09-14 20:34:48 +05:30
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