fix HELM PLUGINS behavior another_way

Signed-off-by: yxxhero <aiopsclub@163.com>
pull/10008/head
yxxhero 4 years ago
parent 29d273f985
commit 90fa4c962a

@ -18,16 +18,22 @@ package installer // import "helm.sh/helm/v3/pkg/plugin/installer"
import ( import (
"path/filepath" "path/filepath"
"helm.sh/helm/v3/pkg/helmpath" "helm.sh/helm/v3/pkg/cli"
) )
type base struct { type base struct {
// Source is the reference to a plugin // Source is the reference to a plugin
Source string Source string
// PluginsDirectory is the directory where plugins are installed
PluginsDirectory string
} }
func newBase(source string) base { 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. // Path is where the plugin will be installed.
@ -35,5 +41,5 @@ func (b *base) Path() string {
if b.Source == "" { if b.Source == "" {
return "" return ""
} }
return helmpath.DataPath("plugins", filepath.Base(b.Source)) return filepath.Join(b.PluginsDirectory, filepath.Base(b.Source))
} }

Loading…
Cancel
Save