Commit graph

1438 commits

Author SHA1 Message Date
Matthew Fisher
3dbc4dd53b
Merge pull request #7230 from waveywaves/update/token
feat(cli) Pass token via cli
2020-03-02 12:08:17 -08:00
Matthew Fisher
2c10f96b59
Merge pull request #7556 from unguiculus/template-output
Fix 'helm template' to also print invalid yaml
2020-03-02 12:04:00 -08:00
Matt Farina
a3f92f65e2
Fixes verification output on pull command
When using the --verify flag on the pull command the output was
an internal Go object rather than useful detail. This is a bug.
The output new displays who signed the chart along with the
hash.

Fixes #7624

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-02-28 12:32:45 -05:00
Martin Hickey
53b6580bad
Merge pull request #7692 from eyablokov/patch-1
Update README.md
2020-02-27 15:57:43 +00:00
Evgenii Iablokov
ebd48557b1 Update README.md
Typo fix: Space missed in Markdown header.

Signed-off-by: Evgeniy Yablokov <ey@odoscope.com>
2020-02-27 09:18:13 +01:00
Xiangxuan Liu
d5a2963cc9 Add test for unknown subcommand
Signed-off-by: Xiangxuan Liu <xiangxuan.liu@rightcapital.com>
2020-02-27 15:33:01 +08:00
Xiangxuan Liu
8f962a270c Return "unknown command" error for unknown subcommands
Signed-off-by: Xiangxuan Liu <xiangxuan.liu@rightcapital.com>
2020-02-27 15:30:34 +08: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
Adam Reese
c235470e59
fix(cmd/helm): upgrade go-shellwords
Removes workaround introduced in #7323

Signed-off-by: Adam Reese <adam@reese.io>
2020-02-25 10:42:20 -08:00
Matthew Fisher
ec2e77cded
Merge pull request #7648 from bacongobbler/fix-6794
feat(install): introduce --create-namespace
2020-02-24 11:20:18 -08:00
Marc Khouzam
7f3339cb4e feat(tests): Allow to provision memory driver
The memory driver is used for go tests. It can also be used from the
command-line by setting the environment variable HELM_DRIVER=memory.
In the latter case however, there was no way to pre-provision some
releases.

This commit introduces the HELM_MEMORY_DRIVER_DATA variable which
can be used to provide a colon-separated list of yaml files specifying
releases to provision automatically.

For example:
   HELM_DRIVER=memory \
   HELM_MEMORY_DRIVER_DATA=./testdata/releases.yaml \
   helm list --all-namespaces

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-21 08:44:38 -05: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
7654c18c6b feat(comp): Static completion for plugins
Allow plugins to optionally specify their sub-cmds and flags through a
simple yaml file.

When generating the completion script with the command
'helm completion <bash|zsh>' (and only then), helm will look for that
yaml file in the plugin's directory.  If the file exists, helm will
create cobra commands and flags so that the completion script will
handle them.

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
694cf61aac
feat(install): introduce --create-namespace
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-02-20 12:03:36 -08:00
Vibhav Bobade
4bd3b8fc06 Pass the apiserver address/port via cli, introduce HELM_KUBEAPISERVER envvar
Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
2020-02-20 04:18:10 +05:30
Zhou Hao
e085bfcb46 cmd/helm/search_repo: print info to stderr
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
2020-02-17 14:44:09 +08:00
Sebastian Voinea
561971c381 feat(upgrade): introduce --disable-openapi-validation:
This is a copy of the --disable-openapi-validation flag from the install command as introduced by Matthew Fisher.
See commit 67e57a5fbb

It allows upgrading releases without the need to validate the Kubernetes OpenAPI Schema.

Signed-off-by: Sebastian Voinea <sebastian.voinea@gmx.de>
2020-02-13 21:36:46 +01:00
Reinhard Naegele
a35e124b66 Place rendering invalid YAML under --debug flag
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
2020-02-12 20:36:04 +01:00
Matthew Fisher
38ce4af105
Merge pull request #7553 from bacongobbler/bump-version-3.1
fix(version): bump version to v3.1
2020-02-11 07:12:54 -08:00
Marc Khouzam
e3965e1185 fix(comp): Fix broken completion for --output flag
For commands using the new post-render flag, the completion for the
--output flag was broken.

For example:
   helm install -o <TAB>
   __helm_handle_reply:47: command not found: __helm_output_options

The bash __helm_output_options function is no longer used but was
referred to by mistake.

This commit removes the offending code.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-10 12:55:30 -05:00
Reinhard Naegele
2a73967ca2 Fix 'helm template' to also print invalid yaml
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
2020-02-07 20:14:33 +01: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
Taylor Thomas
cf7a02fac7 chore(*): Removes support for searching the plugin dir
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2020-02-07 10:29:59 -07:00
Taylor Thomas
7a3049a418 chore(postrender): Adds unit tests for exec post renderer
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2020-02-07 10:29:59 -07:00
Taylor Thomas
08fc12a8c3 Adds post-render support
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2020-02-07 10:29:59 -07:00
Matthew Fisher
b0a187756c
Merge pull request #7288 from mnkyl/lint-subcharts
feat(cmd/lint): added flag to lint dependent charts
2020-02-07 08:46:01 -08:00
Marc Khouzam
e6d2d10bad fix(tests): Add namespace support to memory driver
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-07 11:41:47 -05:00
Matthew Fisher
c825a01435
Merge pull request #7440 from mtougeron/helm-template-write-crd-to-spec-file
Render the CRDs to output-dir files
2020-02-07 08:16:16 -08:00
Taylor Thomas
15e2659191 fix(tests): Ignores tarball that will change on dep update
The unit test added to cover #7233 was causing changes to show up in git
when tests were ran. This was due to the dependency build creating a new
tarball. These changes would cause a dirty build when we build our major
versions, so I removed the subchart tarball from git and added the charts
folder for that test chart to the gitignore to avoid any future problems.
Based on all I can see, this should have any impact on the test itself

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2020-02-05 16:50:33 +01: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
Mike Tougeron
e78402d559 fix conflicts
Signed-off-by: Mike Tougeron <tougeron@adobe.com>
2020-02-04 13:16:51 -08:00
Matthew Fisher
3ff3dabd9e
Merge pull request #6819 from bacongobbler/disable-openapi-validation
feat(install): introduce --disable-openapi-validation
2020-02-04 08:32:58 -08:00
Martin Hickey
084ab20f67
feat(template): Allow template output to use release name (#7503)
* Allow template output to use release name

helm template output command uses the chart name only when writing
templates to disk. This changes will also use the release name
to avoid colloiding the path when output nore than one release
of smae chart.

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

* Update after review

Comment:
- https://github.com/helm/helm/pull/7503/files#r374130090

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2020-02-04 17:27:38 +01:00
Karuppiah Natarajan
6cfcc96cea
fix(test) use newly created index instead of ignoring it
Signed-off-by: Karuppiah Natarajan <karuppiah7890@gmail.com>
2020-02-01 14:29:38 +05:30
Nick Lee
9a790c21dd style(cmd/lint): removed slash in subcharts fp
Signed-off-by: Nick Lee <nmkyu.lee@gmail.com>
2020-01-30 15:37:16 -05:00
Lee Bontecou
e483dce289
fix(template): helm template "--show-only" flag producing duplicates when flag used more than once (#7204)
* bugfix template show-only duplicates

Signed-off-by: Lee Bontecou <lbontecou@thezebra.com>

* 7203 - add unittests

Signed-off-by: Lee Bontecou <lbontecou@thezebra.com>

* attempt formatting fix

Signed-off-by: Lee Bontecou <lbontecou@thezebra.com>

* gofmt-ed with -s

Signed-off-by: Lee Bontecou <lbontecou@thezebra.com>

* goimports-ed with -local helm.sh/helm/v3 and gofmt-ed with -s -w

Signed-off-by: Lee Bontecou <lbontecou@thezebra.com>

* Update template_test.go

Signed-off-by: Lee Bontecou <lbontecou@thezebra.com>

* Update template_test.go

Signed-off-by: Lee Bontecou <lbontecou@thezebra.com>
2020-01-30 11:24:09 +00:00
Marc Khouzam
4f4779ca3a fix(comp): Allow zsh completion to handle -n flag
When doing zsh completion, the -n flag would not be handled properly.
Doing
  helm -n<TAB>
would not add the space after the -n.
This was caused by the fact that the -n flag was being swallowed by
the echo command.

To fix this, we use printf instead.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-28 17:22:11 -05: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
Anshul Verma
5e3c7d7eb8 Friendly error message for non-existent Chart while packaging (#7127)
* Fixes #6713 Friedly error message

Signed-off-by: Anshul Verma <ansverma@localhost.localdomain>

* Fixes #6713 Friedly error message

Signed-off-by: Anshul Verma <ansverma@localhost.localdomain>

* chaging error to no such file or directory

Signed-off-by: Anshul Verma <ansverma@localhost.localdomain>

* changed it for the wider stat error messages which comes directly from go standard library.

Signed-off-by: Anshul Verma <ansverma@localhost.localdomain>

* changed it for the wider stat error messages which comes directly from go standard library.

Signed-off-by: Anshul Verma <ansverma@localhost.localdomain>
2020-01-23 11:46:18 +00:00
Matt Farina
238bc18646
Merge pull request #7387 from etashsingh/alpine-example-template
Refactored alpine-pod.yaml file to make the chart work.
2020-01-22 12:30:27 -05:00
Mike Tougeron
804e07300b Render the CRDs to spec files
Signed-off-by: Mike Tougeron <tougeron@adobe.com>
2020-01-20 13:31:26 -08:00
Marc Khouzam
559c405362 fix(test): Remove invalid subcommand in test
The 'home' command was removed for v3, so this commit adapts the tests.
Having an invalid subcommand does not cause problems currently, but
will start causing failures on newer versions of Cobra, which complain
on invalid subcommands.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-19 15:59:04 -05:00
Marc Khouzam
77b900106f fix(comp): Update based on review comments
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-16 21:29:30 -05: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
fc618b4b6e feat(comp): Use cached charts file for speed
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-15 19:02:58 -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
d5d741dfed feat(comp): Support completion for --revision flag
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-15 19:02:58 -05:00
Marc Khouzam
de1ca6784a feat(comp): Support --generate-name in completion
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-01-15 19:02:58 -05:00