55 "os"
66 "os/exec"
77 "strconv"
8+ "strings"
89)
910
1011func getRelease (release , namespace string ) ([]byte , error ) {
@@ -13,7 +14,7 @@ func getRelease(release, namespace string) ([]byte, error) {
1314 args = append (args , "--namespace" , namespace )
1415 }
1516 cmd := exec .Command (os .Getenv ("HELM_BIN" ), args ... )
16- return cmd . Output ( )
17+ return outputWithRichError ( cmd )
1718}
1819
1920func getHooks (release , namespace string ) ([]byte , error ) {
@@ -22,7 +23,7 @@ func getHooks(release, namespace string) ([]byte, error) {
2223 args = append (args , "--namespace" , namespace )
2324 }
2425 cmd := exec .Command (os .Getenv ("HELM_BIN" ), args ... )
25- return cmd . Output ( )
26+ return outputWithRichError ( cmd )
2627}
2728
2829func getRevision (release string , revision int , namespace string ) ([]byte , error ) {
@@ -31,7 +32,7 @@ func getRevision(release string, revision int, namespace string) ([]byte, error)
3132 args = append (args , "--namespace" , namespace )
3233 }
3334 cmd := exec .Command (os .Getenv ("HELM_BIN" ), args ... )
34- return cmd . Output ( )
35+ return outputWithRichError ( cmd )
3536}
3637
3738func getChart (release , namespace string ) (string , error ) {
@@ -40,7 +41,7 @@ func getChart(release, namespace string) (string, error) {
4041 args = append (args , "--namespace" , namespace )
4142 }
4243 cmd := exec .Command (os .Getenv ("HELM_BIN" ), args ... )
43- out , err := cmd . Output ( )
44+ out , err := outputWithRichError ( cmd )
4445 if err != nil {
4546 return "" , err
4647 }
@@ -87,11 +88,12 @@ func (d *diffCmd) template() ([]byte, error) {
8788 args := []string {"template" , d .release , d .chart }
8889 args = append (args , flags ... )
8990 cmd := exec .Command (os .Getenv ("HELM_BIN" ), args ... )
90- return cmd . Output ( )
91+ return outputWithRichError ( cmd )
9192}
9293
9394func (d * diffCmd ) existingValues (f * os.File ) error {
9495 cmd := exec .Command (os .Getenv ("HELM_BIN" ), "get" , "values" , d .release , "--all" )
96+ DebugPrint ("Executing %s" , strings .Join (cmd .Args , " " ))
9597 defer f .Close ()
9698 cmd .Stdout = f
9799 return cmd .Run ()
0 commit comments