fix(pkg/plugin/installer): unix-style paths in HELM_PLUGINS for helm install

Supports unix-style paths (with a colon) in the HELM_PLUGINS env for installing new plugins.

Closes #11310

Signed-off-by: Sergei Karpov <xodmqjw@gmail.com>
pull/11675/head
Sergei Karpov 3 years ago committed by Sergei Karpov
parent eb7150fc61
commit 12dacf0781

@ -30,9 +30,10 @@ type base struct {
func newBase(source string) base { func newBase(source string) base {
settings := cli.New() settings := cli.New()
pluginsDirs := filepath.SplitList(settings.PluginsDirectory)
return base{ return base{
Source: source, Source: source,
PluginsDirectory: settings.PluginsDirectory, PluginsDirectory: pluginsDirs[0],
} }
} }

@ -32,6 +32,10 @@ func TestPath(t *testing.T) {
source: "https://github.com/jkroepke/helm-secrets", source: "https://github.com/jkroepke/helm-secrets",
helmPluginsDir: "/helm/data/plugins", helmPluginsDir: "/helm/data/plugins",
expectPath: "/helm/data/plugins/helm-secrets", expectPath: "/helm/data/plugins/helm-secrets",
}, {
source: "https://github.com/jkroepke/helm-secrets",
helmPluginsDir: "/helm/data/plugins:/remote/helm/data/plugins",
expectPath: "/helm/data/plugins/helm-secrets",
}, },
} }

Loading…
Cancel
Save