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 (
"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))
}

Loading…
Cancel
Save