Commit graph

6186 commits

Author SHA1 Message Date
Cory Snider
79df3926f6 fix(engine): parse fail messages with newlines
The templating engine handles errors originating from the `required` and
`fail` template functions specially, cleaning up the error messages to
be more presentable to users. Go's text/template package unfortunately
does not make this straightforward to implement. Despite
template.ExecError implementing Unwrap, the error value returned from
the template function cannot be retrieved using errors.As. The wrapped
error in ExecError is a pre-formatted error string with the template
function's error string interpolated in with the original error value
erased. Helm works around this limitation by delimiting the
template-supplied message and extracting the message out of the
ExecError string with a regex.

Fix the parsing of `required` and `fail` error messages containing
newlines by setting the regex flag to make `.` match newline characters.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2021-08-10 12:38:43 -04:00
Marc Khouzam
efe2638f87 feat(comp): Move to Cobra's bash completion V2
Cobra's bash completion V2 has the following benefits:
- aligned with the completion logic for the other shells
- provides completion descriptions as for the other shells
- uses a 300-line shell script (versus 4K lines for V1)

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2021-08-02 12:40:14 -04:00
Marc Khouzam
c6dfb490ab feat(comp): Add support for powershell completion
Cobra provides powershell auto-completion out of the box.  This commit
teaches helm how to use it.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2021-08-02 12:38:29 -04:00
Martin Hickey
e9e6b07f62
Merge pull request #9974 from viccuad/fix-win-resolver-test
test: Make internal/resolver/resolver_test.go pass on Win
2021-07-27 10:39:46 +01:00
Víctor Cuadrado Juan
84a07a4774
test: Make internal/resolver/resolver_test.go pass on Win
TestGetLocalPath() needs Windows-specific expected strings.

Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
2021-07-26 16:53:18 +02:00
Martin Hickey
29d273f985
Merge pull request #9967 from longkai/fix-typo
fix(typo): fix typo of storage doc
2021-07-22 16:45:31 +01:00
Matthew Fisher
5946457ce9
Merge pull request #9675 from ndeloof/main
Migrate to oras-go library
2021-07-22 08:41:29 -07:00
longkai
2deb641efd fix(typo): fix typo of storage doc
Signed-off-by: longkai <im.longkai@gmail.com>
2021-07-22 23:32:06 +08:00
Nicolas De Loof
663c569887 Migrate to oras-go library
see https://github.com/deislabs/oras/pull/265

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-07-19 11:52:34 +02:00
Marc Khouzam
6a3daaa7aa fix(tests): Remove unnecessary test
Testing that a bad completion directive was being replaced by the
default one was actually testing Cobra's behaviour.  This is unnecessary
especially since that behaviour changed in the 1.2.0 release.  Helm
tests should focus on testing Helm's behaviour.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2021-07-14 17:40:42 -04:00
Marc Khouzam
95b80ed80b chore(deps): Update to Cobra 1.2.1
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2021-07-14 17:40:42 -04:00
Matt Farina
ea41e790a5
Merge pull request #9763 from sathieu/patch-1
Ensure RawPath match Path when resolving reference
2021-07-14 12:59:18 -04:00
Martin Hickey
433b90c4b6
Merge pull request #9929 from goodfirstissue/main
refactor: use os instead of ioutil's ReadDir
2021-07-12 15:28:30 +01:00
Josh Dolitsky
4bb28b78d9
Merge pull request #9925 from bloodorangeio/github-actions
Add build-pr github actions workflow
2021-07-09 11:25:11 -05:00
Marc Khouzam
6951cd5076 feat(cmd): Allow to specify which repos to update
This is a port to helm v3 of #5182.
A little more flexible than the v2 version, it allows to specify a list
of repositories that should be updated.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2021-07-08 13:01:03 -04:00
Josh Dolitsky
28f44b8269
Revert "Use official golangci-lint action"
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-07-08 10:10:37 -05:00
Josh Dolitsky
07a25a26f6
Use official golangci-lint action
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-07-08 10:06:16 -05:00
Josh Dolitsky
b16091a01a
verify golangci-lint sha256 checksum
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-07-08 09:59:23 -05:00
Kally Fox
f9b1445b63
refactor: use os instead of ioutil's ReadDir
Signed-off-by: Kally Fox <kallydev@gmail.com>
2021-07-08 21:28:42 +08:00
Josh Dolitsky
7605db034d
Use setup-go v2
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-07-07 12:19:59 -05:00
Josh Dolitsky
2f63045f25
Add build-pr github actions workflow
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-07-07 11:04:08 -05:00
Matt Farina
21251378b4
Merge pull request #9870 from mattfarina/fix-9859
Set Helm as manager for managedFields
2021-07-06 15:41:14 -04:00
Matt Farina
8855488272
Merge pull request #9736 from cndoit18/fix-issue-9348
fix(dep update): helm dep update is not respecting the "version" stip…
2021-07-06 14:24:08 -04:00
Adam Reese
862e2b255c
Merge pull request #9916 from adamreese/fix/golangci-timout
fix(ci-lint): increase timeout for golangci-lint
2021-07-06 11:16:10 -07:00
Adam Reese
d1da9e757e
fix(ci-lint): increase timeout for golangci-lint
Signed-off-by: Adam Reese <adam@reese.io>
2021-07-06 10:37:37 -07:00
小龙同学
cf0c6fed51
fix(doc): fix kube client interface doc. (#9882)
- add missing interface methods doc.
- fix some wrong english grammar.

Signed-off-by: longkai <im.longkai@gmail.com>
2021-07-06 10:41:55 -06:00
Matt Farina
eb99434597
Merge pull request #9871 from mattfarina/logging-for-creds
Fix the url being set by WithURL on the getters
2021-06-28 15:38:14 -04:00
Matt Farina
385fcae1ba
Adding test for user/pass without repo on Helm install
Signed-off-by: Matt Farina <matt.farina@suse.com>
2021-06-28 11:36:37 -04:00
Matt Farina
4e2e4084ed
Fix the url being set by WithURL on the getters
The URL passed to the getter for WithURL needs to be a full URL
rather than a chart reference used at the CLI. For example,
bitnami/wordpress can point to the wordpress chart in the bitnami
repo where the bitnami repo is at https://charts.bitnami.com.
WithURL needs the full URL to the repo and not bitnami/wordpress.
This is important because getters use the full URL information.
In this case the http getter uses the host name for SNI handling.

Before this change WithURL was being set to the chart reference
instead of the URL. This was a silent bug.

This change sets WithURL using a URL after for the repo is
available when a reference is used instead of a full url.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2021-06-25 20:42:10 -04:00
Matt Farina
aeb94798f0
Set Helm as manager for managedFields
managedFields were a changed that landed in 1.18. This is an array
under metadata with managedFields. The kubernetes client pkgs that
Helm uses automatically add them.

This change added a manager for the managedFields. The flow for
deciding on the name to use is:

1. An explicit name if one is chosen
2. The base name of the first os.Arg (the binary name) if no name
   explicitly set.
3. unknown if no name set and name cannot be detected

The name is at the package level as there is no other place to easily
set it for Helm v3. Since the name is for the binary or app it should
be ok to set app wide.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2021-06-25 18:36:27 -04:00
Martin Hickey
ae8e88e0d9
Merge pull request #9862 from longkai/refine-http-req
refactor(getter): refine http GET request
2021-06-25 12:47:00 +01:00
longkai
0d9ebc7885 refactor(getter): refine http GET request
It just makes the code better, I suppose the following is rational:

- use standard libaray common constants instead of hardcode though it's
  really common
- close the response body even if the http status code is not 200 OK.
  The doc says *It is the caller's responsibility to close Body*.
- move the `bytes.Buffer` return value declaration where it gets used.

Signed-off-by: longkai <im.longkai@gmail.com>
2021-06-25 13:18:48 +08:00
Adam Reese
fa558f7843
Merge pull request #9828 from cvila84/dep-tls-config
use TLS client information from repo config when downloading a chart
2021-06-21 11:34:22 -07:00
Christophe VILA
8232a76aef use TLS client information from repo config when downloading a chart
Signed-off-by: Christophe VILA <christophe.vila@thalesgroup.com>
2021-06-18 13:41:57 +02:00
Mathieu Parent
dbb4eb6b75 Ensure RawPath match Path when resolving reference
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
2021-06-17 16:25:57 +02:00
Matt Farina
179f90151d
Merge pull request from GHSA-56hp-xqp3-w2jf
tweak basic handling
2021-06-16 11:12:58 -04:00
Matt Farina
17ed9c4cd3
tweak basic handling
Signed-off-by: Matt Farina <matt.farina@suse.com>
2021-06-15 06:53:31 -04:00
Martin Hickey
3e1da5f39c
Merge pull request #9795 from helm/release-3.6
Cherry-pick off the current PRs merged for 3.6.1 release
2021-06-14 09:34:47 +01:00
Mike Ng
877276ceda keep existing behavior of returning ErrReleaseNotFound when release(s) failed to decode
Signed-off-by: Mike Ng <ming@redhat.com>
(cherry picked from commit 3be333b73b)
2021-06-11 17:36:20 +01:00
Mike Ng
f2d7ed8d80 fix(sql storage): Query() should return ErrReleaseNotFound immediately when no records are found
Signed-off-by: Mike Ng <ming@redhat.com>
(cherry picked from commit b86105aebc)
2021-06-11 17:36:07 +01:00
Leon Bentrup
c084ca0259 Add Test cases for repository-config without file extension
Signed-off-by: Leon Bentrup <4458913+xanecs@users.noreply.github.com>
(cherry picked from commit ccada716ee)
2021-06-11 17:34:59 +01:00
Leon Bentrup
7d81733af7 Correctly determine repository-config lockfile path
helm repo add automatically creates a lockfile based on the repository config file path
When the given filepath did not include a file extension, a lockfile in a nonexistent directory
would have been created.

Signed-off-by: Leon Bentrup <4458913+xanecs@users.noreply.github.com>
(cherry picked from commit f091b9cc01)
2021-06-11 17:34:46 +01:00
Marcus Speight
cbd2868ac2 Fixed Test
Signed-off-by: Marcus Speight <marcus.speight@hotmail.co.uk>
Signed-off-by: Marcus Speight <marcus@pmconnect.co.uk>
(cherry picked from commit 7a663a56c2)
2021-06-11 17:33:22 +01:00
Marcus Speight
9fbf594b80 Added test for lint mode
Signed-off-by: Marcus Speight <marcus.speight@hotmail.co.uk>
(cherry picked from commit 8aa42824f9)
2021-06-11 17:33:12 +01:00
Marcus Speight
bcee7a30fe Fail message is now the same as the required message.
Fixed #8973 Helm function 'fail' should not fail when doing 'helm lint'

Signed-off-by: Marcus Speight <marcus.speight@hotmail.co.uk>
(cherry picked from commit 7a0739a863)
2021-06-11 17:32:59 +01:00
yxxhero
80402dc078 fix helm dep build/update doesn't inherit --insecure-skip-tls-verify from helm repo add
Signed-off-by: yxxhero <aiopsclub@163.com>
(cherry picked from commit f735a240b6)
2021-06-11 17:31:53 +01:00
Martin Hickey
281380f31c
Merge pull request #9659 from mladedav/feature/upgrade-dep-up
Feature/upgrade dep up
2021-06-09 15:31:56 +01:00
Martin Hickey
ed7b6c4761
Merge pull request #8470 from mikeshng/sql-query-fix
fix(sql storage): Query() should return ErrReleaseNotFound immediately when no records are found
2021-06-09 14:23:53 +01:00
Martin Hickey
bf486a25cd
Merge pull request #8853 from xanecs/master
Correctly determine lockfile path in helm repo add
2021-06-02 13:10:34 +01:00
Martin Hickey
dffc2a30c7
Merge pull request #9035 from wizbit/fail-message
Fail message is now the same as the required message.
2021-06-02 12:26:39 +01:00