-
Notifications
You must be signed in to change notification settings - Fork 14.4k
KAFKA-19220: Add tests to ensure the internal configs don't return by public APIs by default #19650
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
base: trunk
Are you sure you want to change the base?
Conversation
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.
Thanks @xijiu for this patch, left a little comment
} | ||
|
||
private void assertNotContainsInternalConfig(Config config, Map<String, ConfigDef.ConfigKey> configKeyMap, | ||
Set<String> whiteListSet) { |
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.
Could you avoid using whiteList
, and replace with more neutral terminology.
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.
Sure, I have changed it, PTAL
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.
Thanks, LGTM
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.
@xijiu: LGTM
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.
@xijiu thanks for your patch. I leave two minor comments.
|
||
assertNotNull(configKey); | ||
if (!ignoreConfigNames.contains(configName)) { | ||
assertFalse(configKey.internalConfig); |
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.
Could you please add error message for this assert?
// broker (see org.apache.kafka.common.test.KafkaClusterTestKit.Builder.createNodeConfig()), | ||
// so the API `describeConfigs` will also return these three configurations. However, other internal | ||
// configurations will not be returned | ||
Config brokerConfig = configResourceMap.get(brokerResource); |
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.
Could you please verify the internal config for controller node too?
Add tests to check whether the results returned by the API
createTopics
anddescribeConfigs
contain internal configurations.