pprovenzano commented on code in PR #13374: URL: https://github.com/apache/kafka/pull/13374#discussion_r1145630060
########## core/src/main/scala/kafka/tools/StorageTool.scala: ########## @@ -53,12 +61,23 @@ object StorageTool extends Logging { throw new TerseFailure(s"Must specify a valid KRaft metadata version of at least 3.0.") } val metaProperties = buildMetadataProperties(clusterId, config.get) + val metadataRecords : ArrayBuffer[ApiMessageAndVersion] = ArrayBuffer() + getUserScramCredentialRecords(namespace).foreach { + if (!metadataVersion.isScramSupported()) { + throw new TerseFailure(s"SCRAM is only supported in metadataVersion IBP_3_5_IV0 or later."); Review Comment: Done. ########## core/src/main/scala/kafka/tools/StorageTool.scala: ########## @@ -214,6 +340,24 @@ object StorageTool extends Logging { } } + def buildBootstrapMetadata(metadataVersion: MetadataVersion, + metadataOptionalArguments: Option[ArrayBuffer[ApiMessageAndVersion]], + source: String): BootstrapMetadata = { + + val metadataRecords = new util.ArrayList[ApiMessageAndVersion] + metadataRecords.add(new ApiMessageAndVersion(new FeatureLevelRecord(). + setName(MetadataVersion.FEATURE_NAME). + setFeatureLevel(metadataVersion.featureLevel()), 0.toShort)); + + metadataOptionalArguments.foreach { metadataArguments => + for (record <- metadataArguments) metadataRecords.add(record) + } + + metadataRecords.add(new ApiMessageAndVersion(new NoOpRecord(), 0.toShort)); Review Comment: Fixed -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org