Commit graph

63 commits

Author SHA1 Message Date
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
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