From 1b3418d9e3c2f62810f058c3f64a460a9c79b339 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Fri, 2 Sep 2016 16:22:07 -0600 Subject: [PATCH] fix(helm): removed debug output Also fixed a bug where a `--dry-run` will result in an error because of the recently added status support. There are several other output inconsistencies that I noticed and filed as issue #1135. Closes #1130 --- cmd/helm/install.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/helm/install.go b/cmd/helm/install.go index ee3232d64..a926b3c11 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -119,7 +119,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command { func (i *installCmd) run() error { if flagDebug { - fmt.Printf("Chart path: %s\n", i.chartPath) + fmt.Fprintf(i.out, "Chart path: %s\n", i.chartPath) } rawVals, err := i.vals() @@ -134,7 +134,7 @@ func (i *installCmd) run() error { return err } // Print the final name so the user knows what the final name of the release is. - fmt.Printf("final name: %s\n", i.name) + fmt.Printf("Final name: %s\n", i.name) } res, err := i.client.InstallRelease( @@ -155,6 +155,11 @@ func (i *installCmd) run() error { } i.printRelease(rel) + // If this is a dry run, we can't display status. + if i.dryRun { + return nil + } + // Print the status like status command does status, err := i.client.ReleaseStatus(rel.Name) if err != nil { @@ -250,7 +255,6 @@ func (v *values) Set(data string) error { } } } - fmt.Print(v.pairs) return nil }