Commit Graph
98 Commits
Author SHA1 Message Date
George Jenkins f3065ff1ba Remove plugin deprecated 'UseTunnelDeprecated'
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-07-21 18:03:16 -07:00
Carlos Lima f8204031f1 Fix tests deleting XDG_DATA_HOME
That includes ~/.local/share/keyrings which was the most immediatelly
visible effect.

Signed-off-by: Carlos Lima <carlos@cpan.org>
2025-06-04 09:01:47 +08:00
Matthieu MOREL 56a2bb4188 chore: enable usetesting linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-30 08:12:11 +02:00
Terry Howe cc39d2428f fix: plugin installer test with no Internet
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-05-27 13:34:37 -06:00
findnature ac8d2f9aed refactor: use slices.Contains to simplify code
Signed-off-by: findnature <cricis@aliyun.com>
2025-05-02 09:43:25 +08:00
Justen Stall 280a9ddbdb Merge branch 'main' into stdlib-errors-2
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2025-04-21 12:13:10 -04:00
Benoit Tigeot a9b7732367 could remove embedded field X from selector
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 10:43:48 +02:00
Robert Sirchia 3a19576377 making changes as requested by matt
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-03-10 15:40:10 -04:00
Robert Sirchia 848c134e0c fixing error messages
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-02-28 16:14:48 -05:00
Robert Sirchia c2e6ed8ae5 fixing build error
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-02-28 08:22:53 -05:00
Robert Sirchia 8887d01791 fixing issues with my PR
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-02-27 15:47:28 -05:00
Robert Sirchia c36bc25fb1 fixing missing attributes
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-02-27 14:48:29 -05:00
Robert Sirchia 1ad79a2bb7 converting inline log to slog
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-02-27 14:21:57 -05:00
wangjingcun 8b8cc94822 Use a more direct and less error-prone return value
Signed-off-by: wangjingcun <wangjingcun@aliyun.com>
2025-02-11 23:20:27 +08:00
Matt Farina 35a9ead998 Ensuring the file paths are clean prior to passing to securejoin
securejoin v0.4.0 made a possibly breaking change. Only clean paths
are safe to pass to SecureJoin or they could return an error or
have the wrong path. The details are in the release notes for v0.4.0.

This change ensures the paths are clean prior to passing to SecureJoin.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-01-14 15:30:44 -05:00
Matt Farina 2236294119 Updating to helm.sh/helm/v4
Since Helm is going through breaking changes with Helm v4, the version path to
Helm needs to be updated.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-12-26 16:33:51 -05:00
Steve Hipwell bb9f0f7816 feat: Added multi-platform plugin hook support
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
2024-11-21 17:39:00 +00:00
Justen Stall 6aa19b8c92 more error wrapping uses
- replace os.IsNotExist with errors.Is and fs.ErrNotExist
- use %w directive

Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2024-11-18 12:54:09 -05:00
Justen Stall 63cf42a843 fix: replace "github.com/pkg/errors" with stdlib "errors" package
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2024-11-18 11:35:59 -05:00
Tianle Xu a51ea6ec73 Allow tests to run on loong64
Signed-off-by: Tianle Xu <xtl@xtlsoft.top>
2024-10-28 21:54:10 +08:00
Matt Farina 764557c470 Some fixes
Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-02-21 09:45:58 -05:00
Matt Farina 847369c184 Update to Go 1.21 for builds
Noteis:
1. This moves golangci scanning to a GitHub action. This will
   enable inline pointers to issues in the PR where linting fails.
2. Go 1.21 is specified in the go.mod because Kubernetes libs
   require it.
3. The lint issues were removed. Some were fixed while others
   were handled by skipping linting or using _ as an argument.
   Many of these can be refactored later for better cleanup.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-01-08 15:48:36 -05:00
Joe Julian 6d96283c0b Merge pull request #12204 from CARV-ICS-FORTH/riscv64
Add support for RISC-V
2024-01-05 16:30:18 -08:00
Matt Farina dbef83eac3 Merge pull request #10913 from sureshdsk/pluginbug
fix: plugin does not load when helm base dir contains space
2023-09-18 15:20:00 -04:00
Eng Zer Jun 2ceebffc77 test: replace ensure.TempDir with t.TempDir
This commit replaces `ensure.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ensure.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-07-29 16:11:22 +08:00
Antony Chazapis 786707c065 Add support for RISC-V
Signed-off-by: Antony Chazapis <chazapis@ics.forth.gr>
2023-07-13 11:56:56 +03:00
Dirk Müller 1fc8369356 Fix 32bit-x86 typo in testsuite
The GOARCH here is 386 not i386. This caused a slightly odd test
suite failure on that architecture:

--- FAIL: TestPlatformPrepareCommand (0.00s)
     plugin_test.go:45: Expected arg="os-arch", got "linux-s390x"
     plugin_test.go:64: Expected arg="os-arch", got "linux-s390x"

Signed-off-by: Dirk Müller <dirk@dmllr.de>
2023-03-28 15:10:19 +02:00
Matt Farina 4e7e939f19 Updating the Go version in go.mod
At this time both Go 1.19 and 1.20 are supported. The version
specified in the go.mod file is the minimum version we expect Helm
to be compiled against. This is the oldest supported version to
support environments where others compile Helm. The Helm project
is using Go 1.20 to build Helm itself.

Updating to Go 1.19 also includes dealing with io/ioutil
deprecation and some additional linting issues around staticcheck.
All the staticcheck issues were in test files so linting was
skipped for those.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-03-22 11:52:30 -04:00
Philipp Stehle 965f8591e7 improve error message on plugin install
Signed-off-by: Philipp Stehle <philipp.stehle@sap.com>
2022-11-09 10:41:55 +01:00
cui fliter 09d3f31358 fix a few function names on comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-10-17 20:41:59 +08:00
Suresh Kumar d7a5f54b6f test: added tests to load plugin from home dir with space
Signed-off-by: Suresh Kumar <sureshdsk91@gmail.com>
2022-05-01 08:59:16 +05:30
Suresh Kumar 2b49de0860 fix: plugin does not load when helm base dir contains space
Signed-off-by: Suresh Kumar <sureshdsk91@gmail.com>
2022-04-29 17:02:45 +05:30
Eng Zer Jun 2e3e22a003 test: use T.TempDir to create temporary test directory
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-02-12 13:54:54 +08:00
Tyler AuerbeckandTyler Auerbeck 4bf99e54eb Update HELM_PLUGIN_SELF -> HELM_PLUGIN_DIR (#10380)
* Update HELM_PLUGIN_SELF -> HELM_PLUGIN_DIR

Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>

* Trigger Build

Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>

Co-authored-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
2021-11-25 23:50:53 -08:00
yxxhero 133c227331 add unittest
Signed-off-by: yxxhero <aiopsclub@163.com>
2021-08-07 09:48:37 +08:00
yxxhero 90fa4c962a fix HELM PLUGINS behavior another_way
Signed-off-by: yxxhero <aiopsclub@163.com>
2021-08-07 09:38:17 +08:00
Martin Hickey 699ea6dcef Merge pull request #9066 from scaat/fix-specification
[FIX]Unified go specification
2021-06-02 11:55:53 +01:00
Josh Soref 2bf8fdf45d chore: Spelling (#9410)
* spelling: annotate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: asserts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: behavior

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: binary

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contain

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: copied

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: depending

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: deprecated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: doesn't

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: donot

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: inputting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: iteration

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: jabberwocky

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: kubernetes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: length

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mismatch

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: outputs

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: panicking

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: plugins

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: parsing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: porthos

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: regular

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: resource

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repositories

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: something

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: strict

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: string

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unknown

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-15 21:11:57 -04:00
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
Scaat Feng 89f2f84a02 [FIX]error string should not be capitalized
Signed-off-by: Scaat Feng <scaat.feng@gmail.com>
2020-11-26 14:13:38 +08:00
Ma Xinjian 1aa6e928ce Cleanup tempfiles introduced by unit tests under pkg/
Signed-off-by: Ma Xinjian <maxj.fnst@cn.fujitsu.com>
2020-11-23 17:22:52 +08:00
Matthew Fisher 6eeec4a002 switched to stricter YAML parsing on plugin metadata files
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-09-17 11:38:28 -07:00
Matt Butcher 809e2d999e Merge pull request from GHSA-m54r-vrmv-hw33
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-09-17 12:35:10 -06:00
Matt Butcher e2da16f514 improve the HTTP detection for tar archives
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-09-17 11:54:07 -06:00
Matt Butcher b6bbe4f08b Improve the extractor and add tests (#8317)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-06-15 16:39:39 -06:00
Matt Farina 512544b9ab Fixing PAX Header handling (#8086)
* Fixing issue with PAX headers in plugin archive

PAX Headers can be added by some systems that create archives. Helm
should ignore them when extracting.

There are two PAX headers. One is global and the other is not. Both
are ignored. The test adds only the PAX global header because the
Go tar package is unable to write the header that is not global.

Closes #8084

Signed-off-by: Matt Farina <matt@mattfarina.com>

* Removing the PAX header test as it is not working

The PAX header test was making a WriteHeader call and ignoring the
error. When writing the type TypeXHeader it was causing an error
that was being silently ignored. The Go tar package cannot write
this type and produces an error when one tries to. The error reads
"cannot manually encode TypeXHeader, TypeGNULongName, or TypeGNULongLink
headers"

Signed-off-by: Matt Farina <matt@mattfarina.com>

* Adding check of returned error in test

Adding a check for the returned error to make sure a non-nil value
is not returned.

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-05-13 17:09:27 -05:00
Liu Ming e1aaf995a6 refactor: alter constant pluginFileName to PluginFileName
in order to reuse the "plugin.yaml" value in installer package
and avoid magic value in installer.go

Signed-off-by: Liu Ming <hit_oak_tree@126.com>
2020-05-05 23:50:45 +08:00
Adam Reese 4a0dfbe53b fix(pkg/cli): ensure correct configuration from kubeconfig file
Bind Helm flags to Kubernetes configuration loader to get a merged
config with kubeconfig.

Fixes: #7539

Signed-off-by: Adam Reese <adam@reese.io>
2020-04-23 12:20:14 -07:00
Adam Reese 1cdd0a2048 fix(pkg/plugin): copy plugins directly to the data directory (#7962)
Copy plugins from the cache rather than create a symlink.

fixes: #7206

Signed-off-by: Adam Reese <adam@reese.io>
2020-04-22 15:33:01 -07:00
ZouYu df9cf87cbe add unit test for function FindPlugins
Signed-off-by: ZouYu <zouy.fnst@cn.fujitsu.com>
2020-04-16 14:12:40 +08:00