Commit Graph

205 Commits

Author SHA1 Message Date
Adam Reese 657ce552cb
fix(*): Validate metadata semver and printable characters
ref: https://github.com/helm/helm/security/advisories/GHSA-c38g-469g-cmgx

* Skip invalid chart versions when reading the repository index file or
  when programmatically adding a chart version.
* Adds semver validation and strips non-printable characters and
  normalizes spaces for string fields in Metadata.Validate()
* Fixes a unit test that was pulling a remote repo.  Now uses a local
  repo.
* Fixes ignored error in repo update command

Signed-off-by: Adam Reese <adam@reese.io>
2021-02-04 12:52:24 -08:00
Matt Farina 8082f6db45 bump version to
Signed-off-by: Matt Farina <matt@mattfarina.com>
(cherry picked from commit f546ebb1ac)
2021-01-05 21:37:16 -05:00
Matt Farina 49f895db6b
Merge pull request #8843 from bloodorangeio/oci-pull
Signed-off-by: Matt Farina <matt@mattfarina.com>
2021-01-05 16:09:19 -05:00
Scott Rigby c495e88250
Replace Helm Hub with Artifact Hub (#8626)
* Replace Helm Hub with Artifact Hub

Signed-off-by: Scott Rigby <scott@r6by.com>

* Update link to new doc entry for Monocular compatible search API

Signed-off-by: Scott Rigby <scott@r6by.com>

* Add struct for Artifact Hub data, and return correct URL for both artifact hub instances and backwards compatibility for Monocular search API

Signed-off-by: Scott Rigby <scott@r6by.com>

* Keep default endpoint hub.helm.sh, so the helm org controls the domain. At least until artifacthub moves to CNCF incubation

Signed-off-by: Scott Rigby <scott@r6by.com>
2020-12-17 12:17:04 -07:00
Peter Engelbert 3028c55858 Clean up imports and add doc comments
Additionally, revert `NewPull()` to its existing signature.

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2020-12-11 21:44:46 -06:00
Peter Engelbert 3ad08f3ea9 Implement `helm pull` for OCI registries
* Implement `helm dep update` for oci dependencies
* New unit tests
* Remove `helm chart pull` command
* New `helm pull` does not depend on registry cache

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2020-12-11 21:44:30 -06:00
Matt Farina ce4fa95868 bump version to v3.4.0
Signed-off-by: Matt Farina <matt@mattfarina.com>
(cherry picked from commit 7090a89efc)
2020-10-19 17:35:25 -04:00
Matt Butcher fe2d7f7792
this rewrites a whole bunch of old repo URLs to the new repo URL (#8902)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-10-19 14:38:32 -06:00
bellkeyang fbc32aea3d
bufix: fix validateNumColons docs
Signed-off-by: bellkeyang <bellkeyang@tencent.com>
2020-07-31 20:44:05 +08:00
Matt Farina ff147e9ed7
Locking file URIs to a version in lockfile
Previously, if a range was specified for a file:// url as a
dependency the range would be put in the lockfile. Lockfiles are
designed to pin to a specific version and not support ranges. This
is for reproducibility.

The change here pins to a the specific version of the chart
specified using the file:// when update is run.

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-07-22 15:42:26 -04:00
Bridget Kromhout c709e10b32
Reinstating comment that is still accurate
Signed-off-by: Bridget Kromhout <bridget@kromhout.org>
2020-07-14 11:05:37 -05:00
Bridget Kromhout fe40c4bf84
Clarify comments to match practice
Signed-off-by: Bridget Kromhout <bridget@kromhout.org>
2020-07-13 15:31:26 -05:00
Matthew Fisher fc4a11c131
bump version to v3.3
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
(cherry picked from commit 5c2dfaad84)
2020-07-07 10:40:09 -07:00
Peter Engelbert 7e9a83184c
Determine chart digest by manifest (#8249)
Currently, whenever the chart is printed, the digest of the .tar.gz
content layer is printed as the digest. The manifest digest is important
for OCI purposes, particularly in pushing to a registry.

Resolves #8248.

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2020-06-29 16:55:01 -05:00
Guangwen Feng 7ec501155d Fix golint issue
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
2020-06-29 15:20:23 +08:00
Matthew Fisher 65ee1e0bc1
Merge pull request #7356 from EItanya/helm-7351
--registry-config flag is not honored
2020-06-24 10:41:41 -07:00
Matthew Fisher 47feb20042
Merge pull request #8220 from bloodorangeio/fix-helm-chart-list-crash-bug
Fix crashing `helm chart list` with large list
2020-06-23 08:05:39 -07:00
Matthew Fisher 67c02d0a6e
Merge pull request #8299 from Hellcatlk/UnitTestCase
Add unit test case
2020-06-16 09:57:21 -07:00
ZouYu 9249530b77 Add unit test case
Signed-off-by: ZouYu <zouy.fnst@cn.fujitsu.com>
2020-06-12 15:18:02 +08:00
Marc Khouzam 88a3d6eaea feat(comp): Move custom completions to Cobra 1.0
Cobra 1.0 introduces custom Go completions.  This commit replaces Helm's
own solution to use Cobra's solution.

This allows to completely remove Helm's internal "completion" package.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-06-11 16:52:39 -04:00
Adam Reese a01adcebfd
Merge pull request #8089 from junaid18183/master
Fixes repo parsing
2020-06-11 11:15:33 -07:00
Peter Engelbert f11e74ee57 Add unit test for man-in-the-middle attack on pull
Add a unit test that proves the digest of the received content being
checked. The check should ensure that the digest of the received content
is identical to the digest provided by the manifest in the layers[0]
descriptor. This check is currently implemented in containerd, so the
unit test ensures security in the case a breaking change is made in
containerd.

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2020-06-04 14:58:03 -05:00
Eitan Yarmush 2b882df636
Merge branch 'master' into helm-7351 2020-06-04 10:27:49 -04:00
Peter Engelbert a0fd1d81f0 Fix crashing `helm chart list` with large list
With a large list of charts, `helm chart list` will crash with the
following message:

```
$ helm chart list --debug
Error: open
/home/me/.cache/helm/registry/cache/blobs/sha256/109971e44d63f7fd11fff60d19db41c2429a136943be2e3f8fd3e4c165156536:
too many open files
helm.go:75: [debug] open
/home/me/.cache/helm/registry/cache/blobs/sha256/109971e44d63f7fd11fff60d19db41c2429a136943be2e3f8fd3e4c165156536:
too many open files
```

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2020-05-28 13:58:33 -05:00
Adam Reese 44a2225035
ref(tests): localize unit test fixtures to package
Use test fixtures that are in the same package as test.

Signed-off-by: Adam Reese <adam@reese.io>
2020-05-22 11:39:20 -07:00
Matt Butcher 59eed4e81f
feat: make the linter coalesce the passed-in values before running values tests (#7984)
* fix: make the linter coalesce the passed-in values before running values tests

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>

* fixed typo

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-05-12 14:23:25 -06:00
Juned Memon 95e9e18ab5
Removed scheme
Signed-off-by: Juned Memon <junaid18183@gmail.com>
2020-05-11 07:51:45 +05:30
Juned Memon 8cb9ab7095
Fixes repo parsing
Signed-off-by: Juned Memon <junaid18183@gmail.com>
2020-05-09 18:05:54 +05:30
Juned Memon b473f8adec
Fixes repo parsing
Signed-off-by: Juned Memon <junaid18183@gmail.com>
2020-05-09 17:10:33 +05:30
Matt Farina f90b842d3e
Merge branch 'master' into xdg 2020-05-05 10:07:10 -04:00
Matt Butcher 8316a403ed bump version to v3.2
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
(cherry picked from commit 7bffac813d)
2020-05-04 18:20:04 -04:00
Matt Farina 2334195a01
Adding Helm env vars where XDG exposed
Helm had been exposing XDG based variables to end users. This lead
to confusion. For example, if a user wanted to change the cache
location Helm used should they change the XDG variable? Since this
would be like changing the HOME environment variable the answer
is no.

This change adds HELM_*_HOME environment variables to be used
in addition to XDG ones of the same name. Helm will now look
for the Helm specific variable. If not set, Helm will fall
back to XDG locations. If those are not set a default location
will be used. This keeps XDG in use as a default when present,
provides users with the ability to set the location, and removes
XDG from being exposed to end users to avoid confusion.

Closes #7919

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-04-28 11:28:56 -04:00
Matt Farina 2139e82c68
Merge pull request #7972 from IppX/bug/6081-bom-in-resource-file
Remove utf-8 BOM when loading chart files and helmignore
2020-04-28 10:46:09 -04:00
Raphaël 984d2ac767
fix: write index.yaml file atomically (#7954)
* fix: write index.yaml file atomically

This refactors the already-existing `AtomicWriteFile` utility
to a central location and uses it to write index files
atomically.
This is done to avoid having half-written index files break
client requests.

Drive-bys:
  - Add test for AtomicWriteFile.
  - Add test IndexFile.WriteFile.
Signed-off-by: rabadin <rvbadin@gmail.com>

* Review fix: use RenameWithFallback instead of os.Rename

Signed-off-by: rabadin <rvbadin@gmail.com>

Co-authored-by: rabadin <rvbadin@gmail.com>
2020-04-24 15:03:47 -06:00
Thomas FREYSS 27ebfa8c56 fix(*): remove bom in utf files when loading chart files (#6081)
Removes the BOM prefix if present, in read files before
processing the data.
Affects the following pkg:
- pkg/chart/loader: directory and archive loader
- internal/ignore: when loading .helmignore file

Signed-off-by: Thomas FREYSS <thomas.freyss@gmail.com>
2020-04-23 14:56:26 +02:00
Matt Farina b21b009785
Merge pull request #7147 from pmacik/fix-unknown-userid
fs_test.go: Assume non-root user instead of failing the test.
2020-04-20 17:29:16 -04:00
Predrag Knezevic b83d3d415c fs_test: use os.Getuid() instead user.Current() to determine if a test is executed with root privileges.
This change lower the expectations on test env setup, i.e. tests could be executed in a container under a random UID,
without require an user in /etc/passwd

Signed-off-by: Predrag Knezevic <pknezevi@redhat.com>
2020-04-20 17:58:40 +02:00
Adam Reese c2da4fd53d
ref(*): kubernetes v1.18 (#7831)
Upgrade Kubernetes libraries to v0.18.0

Add new lazy load KubernetesClientSet to avoid missing kubeconfig error

In kubernetes v1.18 kubeconfig validation was added.  Minikube and Kind
both remove kubeconfig when stopping clusters.  This causes and error
when running any helm commands because we initialize the client before
executing the command.

Signed-off-by: Adam Reese <adam@reese.io>
2020-04-13 08:40:38 -07:00
EItanya 872d9bcb0e Merge branch 'master' of github.com:helm/helm into helm-7351 2020-03-03 20:18:57 -05:00
Matt Butcher 16024dc19a
fix: add new static linter and fix issues it found (#7655)
* fix: add new static linter and fix issues it found

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>

* fixed two additional linter errors.

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-03-03 17:28:57 -07:00
Pavel Macík f05ffdd2da
Fix golangci-lint errors.
Signed-off-by: Pavel Macík <pavel.macik@gmail.com>
2020-02-26 14:08:12 +01:00
Marc Khouzam 97e353bda5 feat(comp): Dynamic completion for plugins
For each plugin, helm registers a ValidArgsFunction which the completion
script will call when it needs dynamic completion.  This
ValidArgsFunction will setup the plugin environment and then call the
executable `plugin.complete`, if it is provided by the plugin.

The output of the call to `plugin.complete` will be used as completion
choices.  The last line of the output can optionally be used by the
plugin to specify a completion directive.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-21 08:01:40 -05:00
Marc Khouzam d6fad6b3c6 feat(comp): Move kube-context completion to Go
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-20 17:12:39 -05:00
Matthew Fisher 0977ded29a
bump version to v3.1
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-02-07 10:42:39 -08:00
Matthew Fisher 8b6233fc3e
fix(version): fix typo in doc comment
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-02-07 10:32:37 -08:00
Martin Hickey 5ec70ab27f
fix(chart): lock digest differs when dependency build with Helm 2 and then Helm 3 (#7261)
* Fix issue with apiVersion v1 lock digest

When apiVersion v1 chart dependencies are built with Helm 2
and then built with Helm 3, the lock digests differ. To avoid
this issue, a depdendency update is forced.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Check against Helm v2 hash

Handle scenario where dependency hash was generated by Helm v2
but need to do a dependency build with Helm v3.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Add unit test

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Refactor unit test

Refactor unit test to use an existing chart as dependency

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Update after review

Comments:
- https://github.com/helm/helm/pull/7261#discussion_r373827088
- https://github.com/helm/helm/pull/7261#discussion_r373827250

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2020-02-05 09:38:30 +01:00
Josh Dolitsky 7ce29e12fa
ref(go.mod): oras v0.8.1 (#6862)
* ref(go.mod): oras v0.8.1

Signed-off-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>

* update various module versions

Signed-off-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>

* upgrade oras v0.8.1

Signed-off-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>

* upgrade to oras 0.8.1 release

Signed-off-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>

* lock to oras release (0.8.1)

Signed-off-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>
2020-02-04 13:54:13 -06:00
Marc Khouzam 1897d4d60a fix(tests): Make tests pass on MacOS
This newly added tests was failing on MacOS because /proc does not
exist.  This commit replaces /proc with /tmp to achieve the same result.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-03 09:20:55 -05:00
Matthew Fisher 98cae60cff
Merge pull request #7329 from fenggw-fnst/work
Add corresponding unit test to the function in resolver.go
2020-01-30 10:31:43 -08:00
Marc Khouzam a8369db802 feat(comp): Isolate go completion framework better
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-15 19:30:04 -05:00
Marc Khouzam 0095e32001 feat(test): add some completion tests
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-15 19:02:58 -05:00
Marc Khouzam 90548c591d feat(comp): Don't use error codes for completion
To use error codes to indicate completion directive to the completion
script had us use os.Exit() in the __complete command.  This prevented
go tests calling the __complete command from succeeding.

Another option was to return an error containing an error code
(like is done for helm plugins) instead of calling os.Exit().  However
such an approach requires a change in how helm handles the returned
error of a Cobra command; although we can do this for Helm, it would
be an annoying requirement for other programs if we ever push this
completion logic into Cobra.

The chosen solution instead is to printout the directive at the end
of the list of completions, and have the completion script extract it.
Note that we print both the completions and directive to stdout.
It would have been interesting to print the completions to stdout and
the directive to stderr; however, it is very complicated for the
completion script to extract both stdout and stderr to different
variables, and even if possible, such code would not be portable to
many shells.  Printing both to stdout is much simpler.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-15 19:02:58 -05:00
Marc Khouzam 62c9c34d49 feat(comp): Dynamic completion of flags in Go
Conflicts:
	cmd/helm/completion/complete.go
	cmd/helm/root.go

Conflicts:
	cmd/helm/root.go

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-15 19:02:58 -05:00
Marc Khouzam 9240e78124 feat(comp): Dynamic completion of arguments in Go
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-15 19:02:58 -05:00
EItanya 17dc43f054 added config file string
Signed-off-by: EItanya <eitan.yarmush@solo.io>
2020-01-08 14:06:43 -05:00
Nguyen Hai Truong 451e2158ad Remove duplicated words (#7336)
Although it is spelling mistakes, it might make an affects while reading.

Signed-off-by: Nguyen Hai Truong <truongnh@fujitsu.com>
Signed-off-by: EItanya <eitan.yarmush@solo.io>
2020-01-08 14:06:43 -05:00
Nguyen Hai Truong 29cc5efc18 Remove duplicated words (#7336)
Although it is spelling mistakes, it might make an affects while reading.

Signed-off-by: Nguyen Hai Truong <truongnh@fujitsu.com>
2020-01-06 15:54:47 +00:00
Guangwen Feng 476200ed06 Add corresponding unit test to the function in resolver.go
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
2020-01-03 18:21:17 +08:00
Hu Shuai 3eb8df0c5e Fix a typo "the the" -> "the"
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
2019-12-31 13:52:19 +08: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
Matthew Fisher 1d36977224
Merge pull request #6824 from bacongobbler/remove-metadata
ref(version): lift "unreleased" status
2019-12-09 08:18:49 -08:00
Matthew Fisher b0934d6df8
Merge pull request #6914 from bacongobbler/remove-serverconfig
ref(tlsutil): remove ServerConfig
2019-11-25 10:36:21 -08:00
Matthew Fisher 9ed2a28ede
ref(tlsutil): remove ServerConfig
dead code from Tiller days

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-11-08 07:39:57 -08:00
Matthew Fisher aa6104e442
fix(tlsutil): accept only a CA certificate for validation
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-11-08 07:36:24 -08:00
Matthew Fisher c9b127c3ee
fix(getter): set up TLS options during .Get()
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-11-01 15:54:53 -07:00
Matt Farina 9f1dc3b0d5
Merge pull request #6750 from ysh7/support-cross-device-rename-v3
Support cross device rename for helm v3
2019-10-31 11:09:12 -04:00
Matthew Fisher 1c64d8fb81
fix(version): lift "unreleased" status
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-29 13:52:48 -07: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
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
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
Josh Dolitsky 5e1ad8b025 Change mediatype for chart content layer
Mediatype changed to application/tar+gzip. Please see the
following OCI mailing list item for more info:
https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/pdc1lucm_Ak

Also, improved check for invalid manifests, a nil reference error was
occurring when upgrading from existing cache with old mediatype.

Signed-off-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>
2019-10-24 07:20:37 -05:00
Yagnesh Mistry ceb6bcb318 fix rename for helm dependency upgrade
This code was ported over from PR #5038, #6738 which were originally for helm
v2. The code contains functions from golang/dep/internal/fs for renaming files.

Signed-off-by: Yagnesh Mistry <ysh@live.in>
2019-10-23 02:11:00 +05:30
Matthew Fisher ee8cd8bffb
fix(sympath): walk symbolic links one once
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-18 12:54:48 -07: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
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
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
John Howard 7a22cb88d9 Drop dependency on k8s.io/kubernetes (#6609)
* Drop dependency on k8s.io/kubernetes

https://github.com/helm/helm/issues/6606

Depending on k8s.io/kubernetes is not recommended by Kubernetes, and
forces dependencies of Helm to also depend on them. We are only using
this dependency in one relatively isolated occurance, which can be
easily copied over rather than depending on the entire Kubernetes.

Copying this code is not very desirable, so if we don't want to have
this duplication we can at least use this PR as a PoC and see if we can
get Kubernetes to publish the controller package as a separate Go module
(see
https://github.com/kubernetes/kubernetes/issues/79384#issuecomment-538740756)

Signed-off-by: John Howard <howardjohn@google.com>

* Move to internal

Signed-off-by: John Howard <howardjohn@google.com>

* Exclude third_party from validate-license.sh

Signed-off-by: John Howard <howardjohn@google.com>
2019-10-11 14:13:25 +01:00
Martin Hickey f2aa97e313
fix(helm): Port accept dependency in requirements.yaml from charts directory (#6611)
* Port #6578 to Helm 3

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Update after reviw

Review comments:
- https://github.com/helm/helm/pull/6611#discussion_r332745703

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-10-09 16:35:55 +01:00
Matthew Fisher b02080dc2c
fix(downloader): bypass index cache when repository URL defined
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-03 12:37:05 -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
Adam Reese f76b5f21ad
Merge pull request #6272 from adamreese/feat/initless
feat(cmd/helm): remove need for helm init command
2019-08-26 10:26:11 -07:00
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
Josh Dolitsky af06037d23
chore(registry): upgrade to oras v0.7.0 (#6285)
Also:
* add --insecure flag to "registry login"
* fix bug parsing correct tag when port number present

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
2019-08-26 11:29:01 -05: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
Adam Reese b2d5e41fc7
ref(*): remove dead code
Signed-off-by: Adam Reese <adam@reese.io>
2019-08-19 10:22:27 -07:00
Taylor Thomas 16544c8190 fix(registry): Updates registry to handle go 1.12.8 changes
Go 1.12.8 introduced some breaking fixes (see 3226f2d492)
for a CVE. This broke the way we were doing registry reference parsing.
This removes the call to the containerd libraries in favor of our own
parsing and adds additional unit tests

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-08-15 09:36:51 -06:00
Josh Dolitsky 6095070817
ref(internal/experimental/registry): pkg refactor (#6205)
No more magic separating the metadata from chart tarball - charts are
pushed to registry as a single tarball layer with Chart.yaml in tact.

No more fragile custom symlink chart storage, now following
the OCI Image Layout Specification for chart filesystem cache.

Also:
- Update to ORAS 0.6.0
- Simplify registry client setup with NewClientWithDefaults()
- Remove needless annotations and constants

Fixes #6068
Fixes #6141

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
2019-08-12 15:17:18 -05:00
Matt Farina a6762a38a8
Making the monocular client search path a const
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-08-12 11:41:06 -04:00
Matt Farina 2d4ced9090
Moving monocular client to internal and adding user agent to version pkg
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-08-12 11:41:05 -04: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
Matthew Fisher fe952445bd
feat(cmd): put OCI commands behind a feature gate
This adds a new `gates` package used for interacting with feature gates. It also marks the OCI registry work as experimental, signalling to users that it is not a stable feature of Helm.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-08-08 15:25:17 -07:00
Matthew Fisher c728611e5a
feat(cli): support XDG base directory specification
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-08-02 13:15:03 -07:00
Torsten Walter ec038337a4
support writing multiple resources to the same file
Signed-off-by: Torsten Walter <mail@torstenwalter.de>
2019-07-17 17:55:50 +02:00
Matthew Fisher a24915a079
ref(version): catch some edge cases
- strip GoVersion from `helm version` test output
- catch some edge cases when GitCommit is unset or less than 7 characters
- add a test case for `helm version --short`

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-06-10 15:07:16 -07:00
Tariq Ibrahim 3a36ab67e9
add go version to version cmd output of helm
Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
2019-06-07 13:20:59 -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 2571dbf82f
ref: remove pkg/helm, pkg/hapi, pkg/tiller
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-03-12 09:47:12 -07:00
Martin Hickey 45fb4b1c44 Fix linter warnings
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-02-12 18:18:33 +00: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 4f26b658d8
change copyright to "Copyright The Helm Authors" 2018-08-24 12:03:55 -07:00
Adam Reese 1d2f40c801
ref(cmd): test template cmd using golden files 2018-05-16 12:35:30 -07:00
Adam Reese a02a598c33
ref(tests): simplify cmd test setup/teardown
Ensure proper cleanup of `HELM_HOME` and `HELM_DEBUG`
2018-05-14 09:23:21 -07:00
Adam Reese 75c4df0b56
ref(tests): use golden files for testing command output 2018-05-09 08:37:20 -07:00