Skip to content

Commit

Permalink
surface error from printRA
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Nov 8, 2023
1 parent 46a6ef1 commit d5472c1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ var validateCmd = &cobra.Command{
}

if printfile {
printRA(ra)
err = printRA(ra)
if err != nil {
return err
}
}

err = radixvalidators.IsRadixApplicationValid(ra)
Expand All @@ -68,14 +71,14 @@ var validateCmd = &cobra.Command{
},
}

func printRA(ra *radixv1.RadixApplication) {
func printRA(ra *radixv1.RadixApplication) error {
b, err := yaml.Marshal(ra)
if err != nil {
fmt.Fprint(os.Stderr, err)
return
return err
}

fmt.Fprintf(os.Stdout, "%s\n", b)
return nil
}

func init() {
Expand Down

0 comments on commit d5472c1

Please sign in to comment.