Skip to content

Commit

Permalink
Merge pull request #34 from UKHomeOffice/fixerrormsg
Browse files Browse the repository at this point in the history
Return kubectl provided error message
  • Loading branch information
vaijab authored Dec 1, 2016
2 parents 8395571 + 695039d commit ec8386b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func main() {

app.Action = func(cx *cli.Context) error {
if err := run(cx); err != nil {
logError.Println(err)
logError.Print(err)
return cli.NewExitError("", 1)
}

Expand Down Expand Up @@ -190,6 +190,9 @@ func deploy(c *cli.Context, r *ObjectResource) error {
}
logInfo.Printf("deploying %s/%s", strings.ToLower(r.Kind), r.Name)
if err = cmd.Run(); err != nil {
if errbuf.Len() > 0 {
return fmt.Errorf(errbuf.String())
}
return err
}
logInfo.Print(outbuf.String())
Expand Down

0 comments on commit ec8386b

Please sign in to comment.