chia7712 commented on code in PR #21394:
URL: https://github.com/apache/kafka/pull/21394#discussion_r2789371566
##########
vagrant/base.sh:
##########
@@ -32,12 +32,26 @@ fetch_jdk_tgz() {
if [ ! -e $path ]; then
mkdir -p $(dirname $path)
- curl --retry 5 -s -L
"https://s3-us-west-2.amazonaws.com/kafka-packages/jdk-${jdk_version}.tar.gz"
-o $path
+ curl --retry 5 -s -L
"https://s3-us-west-2.amazonaws.com/kafka-packages/jdk/jdk-${jdk_version}.tar.gz"
-o $path
fi
}
-JDK_MAJOR="${JDK_MAJOR:-17}"
-JDK_FULL="${JDK_FULL:-17-linux-x64}"
+# Validate JDK_MAJOR - must be a version number (e.g., 8u144, 17, 25.0.1),
default to 17 if empty or invalid
Review Comment:
kafka does not support JDK8 any more.
##########
vagrant/base.sh:
##########
@@ -32,12 +32,26 @@ fetch_jdk_tgz() {
if [ ! -e $path ]; then
mkdir -p $(dirname $path)
- curl --retry 5 -s -L
"https://s3-us-west-2.amazonaws.com/kafka-packages/jdk-${jdk_version}.tar.gz"
-o $path
+ curl --retry 5 -s -L
"https://s3-us-west-2.amazonaws.com/kafka-packages/jdk/jdk-${jdk_version}.tar.gz"
-o $path
fi
}
-JDK_MAJOR="${JDK_MAJOR:-17}"
-JDK_FULL="${JDK_FULL:-17-linux-x64}"
+# Validate JDK_MAJOR - must be a version number (e.g., 8u144, 17, 25.0.1),
default to 17 if empty or invalid
+if [[ -z "$JDK_MAJOR" || ! "$JDK_MAJOR" =~ ^[0-9]+(u[0-9]+|(\.[0-9]+)+)?$ ]];
then
+ JDK_MAJOR="17"
+fi
+
+# Validate JDK_ARCH - default to x64 if empty or invalid
+if [[ -z "$JDK_ARCH" || ! "$JDK_ARCH" =~ ^(x64|aarch64)$ ]]; then
+ JDK_ARCH="x64"
Review Comment:
Should we either throw an exception or log a warning if the format is
invalid?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]