|
|
|
@ -19,13 +19,13 @@ import (
|
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
|
|
|
|
"io"
|
|
|
|
|
"path/filepath"
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
"k8s.io/helm/pkg/helm/helmpath"
|
|
|
|
|
"k8s.io/helm/pkg/plugin"
|
|
|
|
|
"k8s.io/helm/pkg/plugin/installer"
|
|
|
|
|
|
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -67,17 +67,22 @@ func (pcmd *pluginUpdateCmd) run() error {
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
var errorPlugins []string
|
|
|
|
|
|
|
|
|
|
for _, name := range pcmd.names {
|
|
|
|
|
if found := findPlugin(plugins, name); found != nil {
|
|
|
|
|
if err := updatePlugin(found, pcmd.home); err != nil {
|
|
|
|
|
fmt.Fprintf(pcmd.out, "Failed to update plugin %s, got error (%v)\n", name, err)
|
|
|
|
|
errorPlugins = append(errorPlugins, fmt.Sprintf("Failed to update plugin %s, got error (%v)", name, err))
|
|
|
|
|
} else {
|
|
|
|
|
fmt.Fprintf(pcmd.out, "Updated plugin: %s\n", name)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
fmt.Fprintf(pcmd.out, "Plugin: %s not found\n", name)
|
|
|
|
|
errorPlugins = append(errorPlugins, fmt.Sprintf("Plugin: %s not found", name))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if len(errorPlugins) > 0 {
|
|
|
|
|
return fmt.Errorf(strings.Join(errorPlugins, "\n"))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|