-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improve handling of invalid topic configurations #10517
Conversation
b93b1b2
to
d294c0f
Compare
topic-operator/src/main/java/io/strimzi/operator/topic/BatchingTopicController.java
Show resolved
Hide resolved
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
/packit test --labels regression |
@fvaleri I pushed a few tweaks to your branch. Could you take a look and let me know if you agree with them, if not we can discuss here. Thanks. |
An invalid topic configuration results in a RuntimeException that fails the whole reconciliation and following periodic reconciliations. Additionally, if you have a batch of 100 topics or more, it can be difficult to spot where the configuration errors is. With this change the TO reports the error in the status of the Kafka topic containing the invalid configuration, and continues with the reconciliation. Signed-off-by: Federico Valeri <[email protected]>
1. Propagate null config value to Kafka as a special case. This an an improvement because the TO generally takes the position that validation of configs should be done my Kafka, not the operator, which allows Kafka to change what's considered valid without needing to update the TO. 2. I figured out that we can pass values of other JSON types as well as null, so I added a test for this. 3. For such types configValueAsString() must return a String, but there's no corresponding ConfigDef.Type, so configValueAsString() must throw something. But let's use something more specific than RuntimeException. Signed-off-by: Tom Bentley <[email protected]>
7a6a7fb
to
a58e9a5
Compare
Thanks for the improvement. It looks good, I just did a rebase due to an import conflict. We are good to go now. |
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, thanks @fvaleri
Signed-off-by: Federico Valeri <[email protected]>
/azp run regression |
Azure Pipelines successfully started running 1 pipeline(s). |
Type of change
Improvement
Description
An invalid topic configuration results in a RuntimeException that fails the whole reconciliation and following periodic reconciliations. Additionally, if you have a batch of 100 topics or more, it can be difficult to spot where the configuration errors is.
With this change the TO reports the error in the status of the Kafka topic containing the invalid configuration, and continues with the reconciliation.
Checklist