Skip to content

Commit

Permalink
KAFKA-17583 Improve the ConfigCommand documentation to show how to se…
Browse files Browse the repository at this point in the history
…t `key=[val1,val2]` (#17243)

Reviewers: Andrew Schofield <[email protected]>, Chia-Ping Tsai <[email protected]>
  • Loading branch information
Linsiyuan9 authored Nov 11, 2024
1 parent 0a81dd5 commit 7e5ffd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/kafka/admin/ConfigCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ object ConfigCommand extends Logging {
val configsToBeAdded = opts.options.valueOf(opts.addConfig)
.split("," + pattern)
.map(_.split("""\s*=\s*""" + pattern, -1))
require(configsToBeAdded.forall(config => config.length == 2), "Invalid entity config: all configs to be added must be in the format \"key=val\".")
require(configsToBeAdded.forall(config => config.length == 2), "Invalid entity config: all configs to be added must be in the format \"key=val\" or \"key=[val1,val2]\" to group values which contain commas.")
//Create properties, parsing square brackets from values if necessary
configsToBeAdded.foreach(pair => props.setProperty(pair(0).trim, pair(1).replaceAll("\\[?\\]?", "").trim))
}
Expand Down

0 comments on commit 7e5ffd3

Please sign in to comment.