From 90fa4c962a16ea0d62f0f9b835760e98ecc33630 Mon Sep 17 00:00:00 2001 From: yxxhero Date: Sat, 7 Aug 2021 09:38:17 +0800 Subject: [PATCH] fix HELM PLUGINS behavior another_way Signed-off-by: yxxhero --- pkg/plugin/installer/base.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/plugin/installer/base.go b/pkg/plugin/installer/base.go index dcc3ad644..ba6a55d55 100644 --- a/pkg/plugin/installer/base.go +++ b/pkg/plugin/installer/base.go @@ -18,16 +18,22 @@ package installer // import "helm.sh/helm/v3/pkg/plugin/installer" import ( "path/filepath" - "helm.sh/helm/v3/pkg/helmpath" + "helm.sh/helm/v3/pkg/cli" ) type base struct { // Source is the reference to a plugin Source string + // PluginsDirectory is the directory where plugins are installed + PluginsDirectory string } func newBase(source string) base { - return base{source} + settings := cli.New() + return base{ + Source: source, + PluginsDirectory: settings.PluginsDirectory, + } } // Path is where the plugin will be installed. @@ -35,5 +41,5 @@ func (b *base) Path() string { if b.Source == "" { return "" } - return helmpath.DataPath("plugins", filepath.Base(b.Source)) + return filepath.Join(b.PluginsDirectory, filepath.Base(b.Source)) }