From f74dae726807b6e646973827f23de851a9618a8c Mon Sep 17 00:00:00 2001 From: devShaik010 <20dpcs044hy@manuu.edu.in> Date: Fri, 19 Jun 2026 01:11:45 +0530 Subject: [PATCH 1/2] fix: install plugins into the first HELM_PLUGINS directory Signed-off-by: devShaik010 <20dpcs044hy@manuu.edu.in> --- internal/plugin/installer/base.go | 8 +++++++- internal/plugin/installer/base_test.go | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/plugin/installer/base.go b/internal/plugin/installer/base.go index c21a245a8..3f736a761 100644 --- a/internal/plugin/installer/base.go +++ b/internal/plugin/installer/base.go @@ -41,5 +41,11 @@ func (b *base) Path() string { if b.Source == "" { return "" } - return filepath.Join(b.PluginsDirectory, filepath.Base(b.Source)) + + pluginsDirectory := b.PluginsDirectory + if pluginsDirectories := filepath.SplitList(b.PluginsDirectory); len(pluginsDirectories) > 0 { + pluginsDirectory = pluginsDirectories[0] + } + + return filepath.Join(pluginsDirectory, filepath.Base(b.Source)) } diff --git a/internal/plugin/installer/base_test.go b/internal/plugin/installer/base_test.go index 6df8ec8a1..9e6ba7c7a 100644 --- a/internal/plugin/installer/base_test.go +++ b/internal/plugin/installer/base_test.go @@ -31,6 +31,10 @@ func TestPath(t *testing.T) { source: "https://github.com/jkroepke/helm-secrets", helmPluginsDir: "/helm/data/plugins", expectPath: "/helm/data/plugins/helm-secrets", + }, { + source: "https://github.com/jkroepke/helm-secrets", + helmPluginsDir: "/helm/data/plugins:/helm/system/plugins", + expectPath: "/helm/data/plugins/helm-secrets", }, } From 46301c2d77f188ac7e41c5f521c758a4d3081d94 Mon Sep 17 00:00:00 2001 From: devShaik010 <20dpcs044hy@manuu.edu.in> Date: Fri, 19 Jun 2026 01:27:27 +0530 Subject: [PATCH 2/2] test: make HELM_PLUGINS regression test portable Signed-off-by: devShaik010 <20dpcs044hy@manuu.edu.in> --- internal/plugin/installer/base_test.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/internal/plugin/installer/base_test.go b/internal/plugin/installer/base_test.go index 9e6ba7c7a..bedf8bef5 100644 --- a/internal/plugin/installer/base_test.go +++ b/internal/plugin/installer/base_test.go @@ -14,10 +14,16 @@ limitations under the License. package installer // import "helm.sh/helm/v4/internal/plugin/installer" import ( + "fmt" + "path/filepath" "testing" ) func TestPath(t *testing.T) { + pluginsDir := filepath.Join(string(filepath.Separator), "helm", "data", "plugins") + systemPluginsDir := filepath.Join(string(filepath.Separator), "helm", "system", "plugins") + pluginSource := "https://github.com/jkroepke/helm-secrets" + tests := []struct { source string helmPluginsDir string @@ -25,16 +31,16 @@ func TestPath(t *testing.T) { }{ { source: "", - helmPluginsDir: "/helm/data/plugins", + helmPluginsDir: pluginsDir, expectPath: "", }, { - source: "https://github.com/jkroepke/helm-secrets", - helmPluginsDir: "/helm/data/plugins", - expectPath: "/helm/data/plugins/helm-secrets", + source: pluginSource, + helmPluginsDir: pluginsDir, + expectPath: filepath.Join(pluginsDir, filepath.Base(pluginSource)), }, { - source: "https://github.com/jkroepke/helm-secrets", - helmPluginsDir: "/helm/data/plugins:/helm/system/plugins", - expectPath: "/helm/data/plugins/helm-secrets", + source: pluginSource, + helmPluginsDir: fmt.Sprintf("%s%c%s", pluginsDir, filepath.ListSeparator, systemPluginsDir), + expectPath: filepath.Join(pluginsDir, filepath.Base(pluginSource)), }, }