diff --git a/cmd/helm/dependency.go b/cmd/helm/dependency.go index 9c51be600..1370adfb0 100644 --- a/cmd/helm/dependency.go +++ b/cmd/helm/dependency.go @@ -150,7 +150,7 @@ func (l *dependencyListCmd) run() error { l.printRequirements(r, l.out) fmt.Fprintln(l.out) - l.printMissing(r, l.out) + l.printMissing(r) return nil } @@ -240,7 +240,7 @@ func (l *dependencyListCmd) printRequirements(reqs *chartutil.Requirements, out } // printMissing prints warnings about charts that are present on disk, but are not in the requirements. -func (l *dependencyListCmd) printMissing(reqs *chartutil.Requirements, out io.Writer) { +func (l *dependencyListCmd) printMissing(reqs *chartutil.Requirements) { folder := filepath.Join(l.chartpath, "charts/*") files, err := filepath.Glob(folder) if err != nil { diff --git a/cmd/helm/install.go b/cmd/helm/install.go index f438ebe04..d831fc9f6 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -229,7 +229,7 @@ func (i *installCmd) run() error { // If checkDependencies returns an error, we have unfullfilled dependencies. // As of Helm 2.4.0, this is treated as a stopping condition: // https://github.com/kubernetes/helm/issues/2209 - if err := checkDependencies(chartRequested, req, i.out); err != nil { + if err := checkDependencies(chartRequested, req); err != nil { return prettyError(err) } } else if err != chartutil.ErrRequirementsNotFound { @@ -434,7 +434,7 @@ func defaultNamespace() string { return "default" } -func checkDependencies(ch *chart.Chart, reqs *chartutil.Requirements, out io.Writer) error { +func checkDependencies(ch *chart.Chart, reqs *chartutil.Requirements) error { missing := []string{} deps := ch.GetDependencies() diff --git a/cmd/helm/package.go b/cmd/helm/package.go index e5ab3643d..c1ad20894 100644 --- a/cmd/helm/package.go +++ b/cmd/helm/package.go @@ -87,7 +87,7 @@ func newPackageCmd(out io.Writer) *cobra.Command { } for i := 0; i < len(args); i++ { pkg.path = args[i] - if err := pkg.run(cmd, args); err != nil { + if err := pkg.run(); err != nil { return err } } @@ -107,7 +107,7 @@ func newPackageCmd(out io.Writer) *cobra.Command { return cmd } -func (p *packageCmd) run(cmd *cobra.Command, args []string) error { +func (p *packageCmd) run() error { path, err := filepath.Abs(p.path) if err != nil { return err @@ -146,7 +146,7 @@ func (p *packageCmd) run(cmd *cobra.Command, args []string) error { } if reqs, err := chartutil.LoadRequirements(ch); err == nil { - if err := checkDependencies(ch, reqs, p.out); err != nil { + if err := checkDependencies(ch, reqs); err != nil { return err } } else { diff --git a/cmd/helm/plugin.go b/cmd/helm/plugin.go index 47e1b361c..cf0b02f09 100644 --- a/cmd/helm/plugin.go +++ b/cmd/helm/plugin.go @@ -21,7 +21,6 @@ import ( "os" "os/exec" - "k8s.io/helm/pkg/helm/helmpath" "k8s.io/helm/pkg/plugin" "github.com/spf13/cobra" @@ -47,7 +46,7 @@ func newPluginCmd(out io.Writer) *cobra.Command { } // runHook will execute a plugin hook. -func runHook(p *plugin.Plugin, event string, home helmpath.Home) error { +func runHook(p *plugin.Plugin, event string) error { hook := p.Metadata.Hooks.Get(event) if hook == "" { return nil diff --git a/cmd/helm/plugin_install.go b/cmd/helm/plugin_install.go index 7ab4d21fa..aa75770fc 100644 --- a/cmd/helm/plugin_install.go +++ b/cmd/helm/plugin_install.go @@ -75,7 +75,7 @@ func (pcmd *pluginInstallCmd) run() error { return err } - if err := runHook(p, plugin.Install, pcmd.home); err != nil { + if err := runHook(p, plugin.Install); err != nil { return err } diff --git a/cmd/helm/plugin_remove.go b/cmd/helm/plugin_remove.go index 83bc863bf..ec1154734 100644 --- a/cmd/helm/plugin_remove.go +++ b/cmd/helm/plugin_remove.go @@ -67,7 +67,7 @@ func (pcmd *pluginRemoveCmd) run() error { var errorPlugins []string for _, name := range pcmd.names { if found := findPlugin(plugins, name); found != nil { - if err := removePlugin(found, pcmd.home); err != nil { + if err := removePlugin(found); err != nil { errorPlugins = append(errorPlugins, fmt.Sprintf("Failed to remove plugin %s, got error (%v)", name, err)) } else { fmt.Fprintf(pcmd.out, "Removed plugin: %s\n", name) @@ -82,11 +82,11 @@ func (pcmd *pluginRemoveCmd) run() error { return nil } -func removePlugin(p *plugin.Plugin, home helmpath.Home) error { +func removePlugin(p *plugin.Plugin) error { if err := os.Remove(p.Dir); err != nil { return err } - return runHook(p, plugin.Delete, home) + return runHook(p, plugin.Delete) } func findPlugin(plugins []*plugin.Plugin, name string) *plugin.Plugin { diff --git a/cmd/helm/plugin_update.go b/cmd/helm/plugin_update.go index 2e19a2175..d3778764d 100644 --- a/cmd/helm/plugin_update.go +++ b/cmd/helm/plugin_update.go @@ -109,5 +109,5 @@ func updatePlugin(p *plugin.Plugin, home helmpath.Home) error { return err } - return runHook(updatedPlugin, plugin.Update, home) + return runHook(updatedPlugin, plugin.Update) } diff --git a/cmd/helm/serve.go b/cmd/helm/serve.go index 1c9a772fe..21ae36da1 100644 --- a/cmd/helm/serve.go +++ b/cmd/helm/serve.go @@ -56,7 +56,7 @@ func newServeCmd(out io.Writer) *cobra.Command { Short: "start a local http web server", Long: serveDesc, PreRunE: func(cmd *cobra.Command, args []string) error { - return srv.complete(args) + return srv.complete() }, RunE: func(cmd *cobra.Command, args []string) error { return srv.run() @@ -71,7 +71,7 @@ func newServeCmd(out io.Writer) *cobra.Command { return cmd } -func (s *serveCmd) complete(args []string) error { +func (s *serveCmd) complete() error { if s.repoPath == "" { s.repoPath = settings.Home.LocalRepository() } diff --git a/cmd/helm/status_test.go b/cmd/helm/status_test.go index 0ab0db08f..40729154c 100644 --- a/cmd/helm/status_test.go +++ b/cmd/helm/status_test.go @@ -78,7 +78,7 @@ func TestStatusCmd(t *testing.T) { args: []string{"flummoxed-chickadee"}, expected: outputWithStatus( fmt.Sprintf("DEPLOYED\n\nTEST SUITE:\nLast Started: %s\nLast Completed: %s\n\n", dateString, dateString) + - fmt.Sprint("TEST \tSTATUS \tINFO \tSTARTED \tCOMPLETED \n") + + "TEST \tSTATUS \tINFO \tSTARTED \tCOMPLETED \n" + fmt.Sprintf("test run 1\tSUCCESS \textra info\t%s\t%s\n", dateString, dateString) + fmt.Sprintf("test run 2\tFAILURE \t \t%s\t%s\n", dateString, dateString)), rel: releaseMockWithStatus(&release.Status{ diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 3be680a9f..7030740f5 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -184,7 +184,7 @@ func (u *upgradeCmd) run() error { // Check chart requirements to make sure all dependencies are present in /charts if ch, err := chartutil.Load(chartPath); err == nil { if req, err := chartutil.LoadRequirements(ch); err == nil { - if err := checkDependencies(ch, req, u.out); err != nil { + if err := checkDependencies(ch, req); err != nil { return err } } else if err != chartutil.ErrRequirementsNotFound {