File tree 1 file changed +6
-11
lines changed
1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,13 @@ source "/usr/bin/versions.sh"
5
5
6
6
FILENAME=" kafka_${SCALA_VERSION} -${KAFKA_VERSION} .tgz"
7
7
8
- # # Versions prior to 0.10.2.1 are not actively mirrored
9
- echo " Downloading kafka $MAJOR_VERSION .$MINOR_VERSION "
10
- if [[ " $MAJOR_VERSION " == " 0" && " $MINOR_VERSION " -lt " 11" ]]; then
11
- echo " Version prior to 0.10.2.1 - downloading direct"
12
- url=" https://archive.apache.org/dist/kafka/${KAFKA_VERSION} /${FILENAME} "
13
- else
14
- url=$( curl --stderr /dev/null " https://www.apache.org/dyn/closer.cgi?path=/kafka/${KAFKA_VERSION} /${FILENAME} &as_json=1" | jq -r ' "\(.preferred)\(.path_info)"' )
15
- fi
8
+ url=$( curl --stderr /dev/null " https://www.apache.org/dyn/closer.cgi?path=/kafka/${KAFKA_VERSION} /${FILENAME} &as_json=1" | jq -r ' "\(.preferred)\(.path_info)"' )
16
9
17
- if [[ -z " $url " ]]; then
18
- echo " Unable to determine mirror for downloading Kafka, the service may be down"
19
- exit 1
10
+ # Test to see if the suggested mirror has this version, currently pre 2.1.1 versions
11
+ # do not appear to be actively mirrored. This may also be useful if closer.cgi is down.
12
+ if [[ ! $( curl -s -f -I " ${url} " ) ]]; then
13
+ echo " Mirror does not have desired version, downloading direct from Apache"
14
+ url=" https://archive.apache.org/dist/kafka/${KAFKA_VERSION} /${FILENAME} "
20
15
fi
21
16
22
17
echo " Downloading Kafka from $url "
You can’t perform that action at this time.
0 commit comments