Commit Graph

53 Commits

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