-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subcmd/apply: Support fail-safe approach #185
subcmd/apply: Support fail-safe approach #185
Conversation
@hhahn-tw Can you please review this one? :) |
@hhahn-tw @petedannemann Can you guys maybe take a look? |
@jkoelker Can you maybe review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a reccomendation to use errors.Join
to concat the errors, if not, you can also use fmt.Errorf
with multiple %w
to achieve the same thing and not drop the error context by rendering it as a string.
44deeff
to
1bf5d02
Compare
errors.Join() is only supported from go 1.20 (this repo is running v1.18). |
1bf5d02
to
430b161
Compare
Up until now, the `apply` command implemented a fail-fast strategy. This means that an attempt to configure a batch of topics (by passing a path to a folder contains a list of topics configurations files) will be terminated upon the first failure (w/o even trying to apply the configuration for the next-in-line topics). This commit introduces the fail-safe support: It allows the user to run the `apply` command in a fail-safe manner, which means that instead of failing upon the first failure, we'll simply continue to the next topic configuration, while aggregating all the errors along the way. Eventually, if there were any errors, all of them will be shown. Signed-off-by: shimon-armis <shimon.turjeman@armis.com>
430b161
to
661868a
Compare
@hhahn-tw Can you please merge this one? |
Thanks once more for your contribution! |
Description
Up until now, the
apply
command implemented a fail-fast strategy. This means that an attempt to configure a batch of topics (by passing a path to a folder contains a list of topics configurations files) will be terminated upon the first failure (w/o even trying to apply the configuration for the next-in-line topics).This commit introduces the fail-safe support:
It allows the user to run the
apply
command in a fail-safe manner, which means that instead of failing upon the first failure, we'll simply continue to the next topic configuration, while aggregating all the errors along the way.Eventually, if there were any errors, all of them will be shown.