Skip to content

Commit 26e0ea7

Browse files
committed
feat: check error on stack configuration and fail fast
1 parent 01d6ffd commit 26e0ea7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmd/victor/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,15 @@ func run(ctx *cli.Context) error {
188188
confs := ctx.StringSlice("configuration")
189189
for _, conf := range confs {
190190
k, v, _ := strings.Cut(conf, " ")
191-
stack.SetConfig(ctx.Context, k, auto.ConfigValue{
191+
if err := stack.SetConfig(ctx.Context, k, auto.ConfigValue{
192192
Value: v,
193-
})
193+
}); err != nil {
194+
fmt.Fprintf(os.Stderr, "an error occurred while setting stack configuration tuple %s: %s", conf, err)
195+
failed = true
196+
}
197+
}
198+
if failed {
199+
return errors.New("one or more errors happened during stack configuration, failing fast.")
194200
}
195201

196202
// Refresh and update

0 commit comments

Comments
 (0)