Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Kafka initialization scripts to support Dataproc image versions >= 3.0 and ensures Java 11 is installed and used when building CMAK. Key changes include conditional GPG key handling, the addition of an ensure_java11 helper function, and simplified OS checks in kafka.sh. Feedback on these changes highlights three critical improvements: validating that the parsed Java major version is a valid integer before comparison to avoid bash syntax errors, mapping the arm64 architecture to aarch64 for the Adoptium API to prevent download failures on ARM-based instances, and adding --batch --yes to the gpg --dearmor command to prevent interactive prompts during non-interactive execution.
…dd gpg --batch --yes
Summary
Fixes
kafka/kafka.shandkafka/kafka-manager.shon Dataproc 3.0+ (including 4.0, Debian 13 and Ubuntu 24):kafka/kafka.sh: Use thegpgkey import path (instead of deprecated/removedapt-key) for all OSes whenDATAPROC_IMAGE_VERSION >= 3.0.kafka/kafka-manager.sh:DATAPROC_IMAGE_VERSION >= 3.0, skipsbt_old.list(rejected by Debian 13sqvdue to SHA-1) and import the sbt key viagpg --batch --yes --dearmorinstead of deprecatedgnupg-ring:.ensure_java11()to install Java 11 (viaopenjdk-11-jdk, falling back to Adoptium Temurin 11 withamd64 -> x64andarm64 -> aarch64mapping) when the system JDK is>= 17, and pass-java-home "${JAVA_HOME}"tosbtso CMAK builds cleanly on Java 21 images.Testing
Verified
KafkaTest.testKafkaNonHACluster(runningkafka/kafka.sh,kafka/cruise-control.sh, andkafka/kafka-manager.sh) passes end-to-end across all affected>= 3.0tracks and flavors (exercising bothopenjdk-11-jdkapt on Ubuntu 24 and Temurin 11 fallback on Debian 13):3.0-debian13: PASSED3.0-ubuntu24: PASSED4.0-debian13: PASSED4.0-ubuntu24: PASSED