Skip to content

Commit

Permalink
feat: check error on stack configuration and fail fast
Browse files Browse the repository at this point in the history
  • Loading branch information
pandatix committed Dec 12, 2023
1 parent 01d6ffd commit 26e0ea7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/victor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,15 @@ func run(ctx *cli.Context) error {
confs := ctx.StringSlice("configuration")
for _, conf := range confs {
k, v, _ := strings.Cut(conf, " ")
stack.SetConfig(ctx.Context, k, auto.ConfigValue{
if err := stack.SetConfig(ctx.Context, k, auto.ConfigValue{
Value: v,
})
}); err != nil {
fmt.Fprintf(os.Stderr, "an error occurred while setting stack configuration tuple %s: %s", conf, err)
failed = true
}
}
if failed {
return errors.New("one or more errors happened during stack configuration, failing fast.")
}

// Refresh and update
Expand Down

0 comments on commit 26e0ea7

Please sign in to comment.