Commit graph

305 commits

Author SHA1 Message Date
Matthew Fisher
faf5cfb2cb
Merge pull request #7189 from pmacik/fix-os.Stat
Repair unit tests failing on Linux caused by using the os.Stat
2020-03-02 12:11:39 -08:00
Martin Hickey
9d7907342d
Merge pull request #7514 from fhopfensperger/fix-7497
fixed dependencies processing in case of helm install or upgrade for …
2020-03-02 09:28:27 +00:00
Tomáš Kohout
b4f716413c Printing name of chart that do not have requested import value.
Signed-off-by: Tomas Kohout <tomas.kohout@leveris.com>
2020-02-24 11:59:51 +01:00
Matt Farina
1bd819a7b2
Fixes issue where <CHARTNAME> is left in starter values file
This is a leftover bug from #7201.

Closes #7532

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-02-06 12:01:03 -05:00
Florian Hopfensperger
d03db32c25 fixed dependencies processing in case of helm install or upgrade for disabled/enabled sub charts
Signed-off-by: Florian Hopfensperger <f.hopfensperger@gmail.com>
2020-02-03 11:30:26 +01:00
Matthew Fisher
50dcd39ba5
fix(package): remove --set, --values, etc. flags
These flags snuck in through a feature that was reverted and removed in Helm 2, but snuck into Helm 3.

They were never hooked up or used, so they were a no-op. This shouldn't affect anyone.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-01-27 10:29:15 -08:00
Shota Nakamura
0beb9f7040 fix(chartutil): remove empty lines and a space from rendered chart templates (#7455)
Signed-off-by: sukimoyoi <alice89yryr0@gmail.com>
2020-01-27 11:00:26 +00:00
Martin Hickey
88f42929d7
Remove references to protobuf (#7425)
Remove references to protobuf and update description of release
object stored representation to Helm v3.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2020-01-17 15:56:56 +00:00
Naseem
a963736f66 [helm create] Include serviceAccount.annotations value (#7246)
* Include serviceAccount.annotations value

Signed-off-by: Naseem <naseemkullah@gmail.com>

* Add comment about service account annotations

Signed-off-by: Naseem <naseemkullah@gmail.com>
2020-01-09 14:04:02 +00:00
Jan Heylen
a2bbb67839 fix(helm): add .orig as typical backup file
Mercurial VCS (hg) backout's can generate '.orig' files
to avoid these being picked, generate a .helmignore where
also the .orig files are ignored.

Signed-off-by: Jan Heylen <jan.heylen@nokia.com>
2019-12-20 17:28:00 +01:00
Romain Grenet
8cb3c02c47 Port PR #4161 Fix incorrect timestamp when helm package to Helmv3
Lint CRLF
Signed-off-by: Romain Grenet <romain.grenet@gmail.com>
2019-12-19 13:22:08 -05:00
Josh Soref
02ad2b1187 Spelling (#7258)
* spelling: constraint

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

* spelling: cryptographic

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

* spelling: dependency

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

* spelling: doesnot

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

* spelling: don't

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

* spelling: unexpected

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

* spelling: dreadnought

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

* spelling: default

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

* spelling: envvars

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

* spelling: evaluates

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

* spelling: execute

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

* spelling: extractor

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

* spelling: frobnitz

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

* spelling: generated

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

* spelling: implementation

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

* spelling: jabba

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

* spelling: keywords

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

* spelling: kubernetes

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

* spelling: override

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

* spelling: package

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

* spelling: parsable

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

* spelling: progress

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

* spelling: recursively

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

* spelling: release

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

* spelling: cache

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

* spelling: representing

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

* spelling: serializer

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

* spelling: subchart

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

* spelling: utilities

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2019-12-18 12:04:08 +00:00
Paul "TBBle" Hampson
0cb0eaca94 fix(*): Helm v3 handling of APIVersion v1 charts dependencies (#7009)
* Include requirements.* as Files in APIVersionV1

Fixes #6974.

This ensures that when reading a Chart marked with APIVersion v1, we
maintain the behaviour of Helm v2 and include the requirements.yaml and
requirements.lock in the Files collection, and hence produce charts that
work correctly with Helm v2.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>

* Write out requirements.lock for APIVersion1 Charts

This keeps the on-disk format consistent after `helm dependency update`
of an APIVersion1 Chart.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>

* Exclude 'dependencies' from APVersion1 Chart.yaml

This fixes `helm lint` against an APIVersion1 chart packaged with Helm
v3.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>

* Generate APIVersion v2 charts for dependency tests

As the generated chart contains no requirements.yaml in its files list,
but has dependencies in its metadata, it is not a valid APIVersion v1
chart.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>

* Generate APIVersion v2 charts for manager tests

Specifically for the charts that have dependencies, the generated chart
contains no requirements.yaml in its files but has dependencies in its
metadata. Hence it is not a valid APIVersion v1 chart.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>
2019-12-11 17:07:05 +00:00
Pavel Macík
e3976ab7a2
Repair failing unit tests - failure caused by os.Stat return values for directory size on Linux.
Signed-off-by: Pavel Macík <pavel.macik@gmail.com>
2019-12-09 14:48:16 +01:00
Graham Goudeau
01aa1bd3a2 Add a flag to allow template to output CRDs
Signed-off-by: Graham Goudeau <graham.goudeau@solo.io>
2019-12-03 14:06:55 -05:00
Jeff Bachtel
2e1c54855e Add namespace option to example kubectl command
Signed-off-by: Jeff Bachtel <jeff.bachtel@ironnetcybersecurity.com>
2019-10-30 14:29:39 -06:00
Taylor Thomas
b6f5762d46 fix(chartutil): Add the v1 apiextensions to the default scheme
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-29 12:10:58 -06:00
Yusuke Kuoka
6d91d1aca8 fix(v3): Allow rendering CRDs in helm template client-only validation
Fixes #6665
Ref https://github.com/helm/helm/pull/6729#issuecomment-547415165
Relates to #6729 and #6811

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2019-10-29 22:23:51 +09:00
Oleg Sidorov
44a81f63f7 Revert "chartutil.ReadValues is forced to unmarshal numbers into json.Number refs #1707 [dev-v3]"
This reverts commit f94bac0643.

Due to a major numeric regression detected in dev-v2 reported in #6708,
we believe the master branch (former dev-v3) is also impacted by this
change and will expose the same set of problems. In order to not
jeopardize the stability of helm3 this commit is reverted in favor of a
better fix in the future.

Signed-off-by: Oleg Sidorov <me@whitebox.io>
2019-10-23 09:27:51 +02:00
Taylor Thomas
a758490f4d fix(chartutil): Uses copystructure for deep copy to avoid using gob
We already had the copystructure library in our dependencies transitively
through sprig. This solves a gob encoding bug that was causing issues with
chart testing

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-17 16:02:51 -05:00
Matthew Fisher
a92dd44cad
Merge pull request #6669 from SimonAlling/err
ref(pkg/chartutil): Improve error handling code in Save
2019-10-17 12:38:54 -07:00
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
Simon Alling
a7c285bf7e ref(pkg/chartutil): Improve error handling code in Save
While working on #6519, it took me hours to figure out why the error
returned from `Save` was nil even though `writeTarContents` returned a
non-nil error. I fixed the bug as part of that PR; the purpose of this
commit is to prevent it from happening again.

What made me (as a Go beginner) so confused was the impression that
there was only ever one `err` variable, global to the entire `Save`
function, when in fact there were also several local ones shadowing it.
(I thought := could be used to reassign an existing variable.)

This commit makes it clear that any `err` defined locally in the last
`if` statement will not be returned at the end, and hence must be
explicitly returned in the body of said `if` statement.

(This commit initially was larger; see #6669.)

Signed-off-by: Simon Alling <alling.simon@gmail.com>
2019-10-16 17:27:47 +02:00
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