From c3c7c322b5119d555fe75c53c3b632eb75054319 Mon Sep 17 00:00:00 2001 From: Yuhui Luo <92632263+lyh7c00@users.noreply.github.com> Date: Mon, 24 Aug 2026 17:05:41 +0800 Subject: [PATCH] fix(plugin): install plugins into the first HELM_PLUGINS directory When HELM_PLUGINS contains a list of directories, plugins should be installed into the first directory. The installer previously used the raw value as a single directory, which failed when a list was configured. Fixes #11310 Signed-off-by: Yuhui Luo <92632263+lyh7c00@users.noreply.github.com> --- internal/plugin/installer/base.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/plugin/installer/base.go b/internal/plugin/installer/base.go index 54d25287a..2e4c16f4a 100644 --- a/internal/plugin/installer/base.go +++ b/internal/plugin/installer/base.go @@ -36,10 +36,21 @@ func newBase(source string) base { } } +// pluginsDir returns the directory where plugins should be installed. When +// HELM_PLUGINS contains a list of directories (separated by the OS path list +// separator), the first directory is the default install target. +func (b *base) pluginsDir() string { + dirs := filepath.SplitList(b.PluginsDirectory) + if len(dirs) == 0 { + return b.PluginsDirectory + } + return dirs[0] +} + // Path is where the plugin will be installed. func (b *base) Path() string { if b.Source == "" { return "" } - return filepath.Join(b.PluginsDirectory, filepath.Base(b.Source)) + return filepath.Join(b.pluginsDir(), filepath.Base(b.Source)) }