Commit graph

1535 commits

Author SHA1 Message Date
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
Matthew Fisher
9ba574f130
Merge pull request #6821 from lamLeX/fix-6820
Porting commit f5986db184
2019-10-30 12:35:43 -07:00
Kamalashree Nagaraj
73db724c6c feat(helm): add linting support for '.tar.gz' tarballs for helm charts (#6829)
When 'helm3 lint <chart-name>.tar.gz' is run, this will lint Chart.yaml in the package

Closes #6535

Signed-off-by: Kamalashree N <nagaraj.kamalashree@gmail.com>
2019-10-30 16:33:26 +00:00
Lam Le
afda6b4940
Porting fix from commit f5986db184
This port fixes the bug #6820 for helm3 
which was fixed in helm2 with the pull request 4850
https://github.com/helm/helm/pull/4850

Signed-off-by: Lam Le <lam281990@gmail.com>
2019-10-29 13:42:21 -07:00
Matthew Fisher
2033853d8c
Merge pull request #6822 from bacongobbler/security-audit
fix(loader): error out when loading irregular files
2019-10-29 13:32:33 -07: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
Taylor Thomas
9322910eb9
Merge pull request #6812 from mumoshu/fix-misisng-apiextensionsv1beta1-on-template-cmd
fix(v3): Allow rendering CRDs in `helm template` client-only validation
2019-10-29 12:05:12 -06:00
Taylor Thomas
6a91263e38 fix(releaseutil): Removes API version checks from kind sorter
The sorting method for manifests contained a check to see if the API
version existed. This violates separation of concerns as the sorter
should just sort and leave validation to other parts of the code.

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-29 11:13:03 -06:00
Matthew Fisher
5a7d4f1f74
fix(loader): error out when loading irregular files
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-29 10:01:26 -07: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
Matthew Fisher
f1dc84773f
Merge pull request #6798 from aaronmell/Make_Namespace_Public
Allow namespace to be set by programs consuming helm.
2019-10-28 11:58:28 -07:00
Matthew Fisher
2c791189f8
Merge pull request #6736 from hangpark/fix/calculate-digest-from-chart-yaml-n-chart-lock
fix(pkg/downloader): Calculate digest from both Chart.lock & Chart.yaml deps
2019-10-28 11:46:41 -07:00
Aaron Mell
31f2fea061 Passing the namespace to actionconfig.Init instead of the entire object.
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-28 13:03:17 -05:00
Aaron Mell
eab9d2817d Revert "Allow namespace to be set by programs consuming helm."
bc2cd3c794

Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-28 12:33:47 -05:00
Hang Park
c72caf6a11
fix(pkg/downloader): Calculate digest from both Chart.lock & Chart.yaml deps
To make digests include information about Chart.yaml dependencies, not
only the lock file, digest calculation is changed to accept both
contents. This terminates the `dep build` command if Chart.yaml
dependencies have been updated so that `dep up` should be executed
properly, to prevent downloading wrong versions or mismatched subcharts.

Note that previous Helm cannot know whether Chart.yaml dependencies were changed
or not since the Chart.lock's digest is calculated by only Chart.lock
contents, which don't include information about SemVer ranges and extra
dependency fields such as aliases, conditions, and tags. Specially,
SemVer can be written as a version range in Chart.yaml, but Chart.lock
has the specific, resolved version of that range.

Signed-off-by: Hang Park <hangpark@kaist.ac.kr>
2019-10-27 22:48:19 +09:00
Aaron Mell
bc2cd3c794 Allow namespace to be set by programs consuming helm.
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-26 23:16:28 -05:00
Taylor Thomas
c69af3d5bd fix(wait): Removes ingress checks
v3 port of #6792

After doing some more digging, I found out that updating the status
of an `Ingress` object is completely optional. Because of this, Helm
cannot support ingresses with the `--wait` flag because there is no
standard way to identify that they are ready

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-25 10:52:37 -06:00
Mateusz Szostok
062235142b fix(repo/search): fix helm repo search command to display proper versions
Introduce the `--devel` flag for `helm repo search` command.

`helm repo search` - searches only for stable releases, prerelease versions will be skip
`helm repo search --devel` - searches for releases and prereleases (alpha, beta, and release candidate releases)
`helm repo search --version 1.0.0 - searches for release in version 1.0.0

Signed-off-by: Mateusz Szostok <szostok.mateusz@gmail.com>
2019-10-24 17:28:51 +02:00
Karuppiah Natarajan
bfd8250803 fix list not showing multiple releases with same name in different namespaces (#6756)
Signed-off-by: Karuppiah Natarajan <karuppiah7890@gmail.com>
2019-10-24 14:34:48 +01: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
Hang Park
9e9999b671
fix(pkg/downloader): Add failing tests for #6416 and bugs due to #5874
This commit includes failing tests for a bug reported by #6416 and
several bugs due to #5874. `helm dependency build` command fails if one
of subcharts has optional dependency fields (e.g. Alias / Condition /
Tags) or SemVer ranges.

Signed-off-by: Hang Park <hangpark@kaist.ac.kr>
2019-10-22 11:38:57 +09:00
Taylor Thomas
25697a62c4 feat(test): Adds --logs flag
This is a v3 port of #6612. There have been significant changes due to the way
Helm 3 refactored things. I chose to add the method for getting logs to the
testing client because it seemed like something that someone using Helm
as an SDK might want. It takes a writer because it is more efficient (less
copying) and can write to any sort of buffer desired

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-17 17:19:17 -05: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
Taylor Thomas
7892a36cb3
Merge pull request #6687 from thomastaylor312/feat/v3_lint
feat(lint): Adds v3 chart checks to linter
2019-10-17 15:33:05 -05:00
Matthew Fisher
b38c413d1b
Merge pull request #6602 from karuppiah7890/fix-url-decode-v3
fix repo url being decoded while downloading repo index
2019-10-17 12:41:43 -07: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
Taylor Thomas
5a23663c6b
Merge pull request #6679 from thomastaylor312/feat/timestamp_hell
feat(*): Adds custom time package for better marshalling
2019-10-17 14:23:25 -05: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
Taylor Thomas
caf629a3e9 feat(lint): Adds v3 chart checks to linter
Fixes #5733

This adds two specific checks. A warning if a chart has a `crd-install` hook
and an error if the chart contains `.Release.Time`. Further checks can be added
down the road as needed using the same pattern I use here

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-17 12:20:47 -05:00
Matthew Fisher
b42967ff51
Merge pull request #6681 from bacongobbler/fix-6642
fix(kube): replace rather than delete/create on `helm install --force`
2019-10-17 09:40:11 -07:00
Matthew Fisher
4d5a62303e
fix(kube): replace rather than delete/create
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-17 09:36:25 -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
Taylor Thomas
93abfd75ad Remove reference to stdtime to reduce confusion
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-16 21:01:52 -05:00
Matthew Fisher
e7413bd61c
Merge pull request #6678 from sidharthsurana/fix-nil-pointer-load
Fix the ordering of the APIVersion check to avoid nil pointer
2019-10-16 11:39:19 -07:00
Sidharth Surana
31d41d3fd1 Add unit test for this specific case of loading from V1 archive
Added a tgz "frobnitz.v1.tgz" of the testdata folder frobnitz.v1
Verified that without the fix the unit test fails and re-produces
the issue.

Signed-off-by: Sidharth Surana <ssurana@vmware.com>
2019-10-16 11:36:53 -07:00
Matthew Fisher
40572311ab
Merge pull request #6488 from bacongobbler/port-6258
fix(downloader): bypass index cache when repository URL defined
2019-10-16 09:10:06 -07:00
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
Taylor Thomas
4d7968f692 ref(time): Adds wrapper for most time stdlib methods
Any method that had a function parameter that was a `Time` or returned a
`Time` is now wrapped so you can use our time wrapper without any weird conventions

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-16 08:47:52 -06:00
Sidharth Surana
8f833fed25 Fix the ordering of the APIVersion check to avoid nil pointer
Signed-off-by: Sidharth Surana <ssurana@vmware.com>
2019-10-15 22:43:33 -07: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
aa429e150a feat(*): Adds custom time package for better marshalling
This package mainly exists to workaround an issue in Go
where the serializer doesn't omit an empty value for time:
https://github.com/golang/go/issues/11939. This replaces all
release and hook object time references with the new time package
so things actually marshal correctly

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-15 14:13:19 -06:00
Aaron Mell
6a98d1f1d2 Code Review Changes
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-14 13:14:14 -05:00
Aaron Mell
4eca26e4e1 Modified the scope of Kubeconfig so it could be set outside an env variable.
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-14 13:14:14 -05:00
Jonas Rutishauser
0650d6953d
Remove all known arguments in plugin invocations
Consistenly remove all arguments which are passed as environment
variables.

Get all arguments from environment variables passed to plugins.

Signed-off-by: Jonas Rutishauser <jonas.rutishauser@alumni.ethz.ch>
2019-10-12 21:50:42 +02:00
Taylor Thomas
01e593fbcd fix(action): Fixes ordering of variable binding
The recent init action config switched the order of how variables get bound
and where. This led to the namespace variable not being propagated down into
the calls to kubernetes.

Co-authored-by: Matthew Fisher <matt.fisher@microsoft.com>
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-11 11:41:57 -06: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
Taylor Thomas
1123e5ca1f fix(cli): Fixes incorrect variable reference
Because these were additions, git didn't pick up that the recent refactor of
env settings had changed some of the variables. This fixes those small changes

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-11 10:21:49 -06:00
Matthew Fisher
ed90425ebb
Merge pull request #6632 from mumoshu/add-plugin-envvars
v3: Propagate --kube-context, --kubeconfig and --namespace values to plugins
2019-10-11 09:05:43 -07:00
Matthew Fisher
36e30472d7
Merge pull request #6639 from jlegrone/set-default-hook-delete-policy
Set default hook deletion policy to before-hook-creation
2019-10-11 09:03:32 -07:00