You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/05/04 18:15:13 UTC

[GitHub] [kafka] cmccabe commented on pull request #12109: KAFKA-13863: Prevent null config value when create topic in KRaft mode

cmccabe commented on PR #12109:
URL: https://github.com/apache/kafka/pull/12109#issuecomment-1117657256

   We already validate that topic configurations can't be null in `ControllerConfigurationValidator`.
   
   ```
     override def validate(
       resource: ConfigResource,
       config: util.Map[String, String]
     ): Unit = {
       resource.`type`() match {
         case TOPIC =>
           validateTopicName(resource.name())
           val properties = new Properties()
           val nullTopicConfigs = new mutable.ArrayBuffer[String]()
           config.entrySet().forEach(e => {
             if (e.getValue() == null) {
               nullTopicConfigs += e.getKey()
             } else {
               properties.setProperty(e.getKey(), e.getValue())
             }
           })
           if (nullTopicConfigs.nonEmpty) {
             throw new InvalidRequestException("Null value not supported for topic configs : " +
               nullTopicConfigs.mkString(","))
           }
   ```
   
   I don't mind adding extra test coverage but there should be no need to change `ReplicationControlManager`, as far as I can see.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org