|
|
@ -28,7 +28,7 @@ import (
|
|
|
|
"helm.sh/helm/v3/pkg/cli"
|
|
|
|
"helm.sh/helm/v3/pkg/cli"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const pluginFileName = "plugin.yaml"
|
|
|
|
const PluginFileName = "plugin.yaml"
|
|
|
|
|
|
|
|
|
|
|
|
// Downloaders represents the plugins capability if it can retrieve
|
|
|
|
// Downloaders represents the plugins capability if it can retrieve
|
|
|
|
// charts from special sources
|
|
|
|
// charts from special sources
|
|
|
@ -159,7 +159,7 @@ func (p *Plugin) PrepareCommand(extraArgs []string) (string, []string, error) {
|
|
|
|
|
|
|
|
|
|
|
|
// LoadDir loads a plugin from the given directory.
|
|
|
|
// LoadDir loads a plugin from the given directory.
|
|
|
|
func LoadDir(dirname string) (*Plugin, error) {
|
|
|
|
func LoadDir(dirname string) (*Plugin, error) {
|
|
|
|
data, err := ioutil.ReadFile(filepath.Join(dirname, pluginFileName))
|
|
|
|
data, err := ioutil.ReadFile(filepath.Join(dirname, PluginFileName))
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -177,7 +177,7 @@ func LoadDir(dirname string) (*Plugin, error) {
|
|
|
|
func LoadAll(basedir string) ([]*Plugin, error) {
|
|
|
|
func LoadAll(basedir string) ([]*Plugin, error) {
|
|
|
|
plugins := []*Plugin{}
|
|
|
|
plugins := []*Plugin{}
|
|
|
|
// We want basedir/*/plugin.yaml
|
|
|
|
// We want basedir/*/plugin.yaml
|
|
|
|
scanpath := filepath.Join(basedir, "*", pluginFileName)
|
|
|
|
scanpath := filepath.Join(basedir, "*", PluginFileName)
|
|
|
|
matches, err := filepath.Glob(scanpath)
|
|
|
|
matches, err := filepath.Glob(scanpath)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return plugins, err
|
|
|
|
return plugins, err
|
|
|
|