2019-12-18 08:29:57 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -eo pipefail
|
|
|
|
|
|
|
|
VERSIONS="$@"
|
2022-02-04 08:14:00 +00:00
|
|
|
ARCHITECTURES="arm arm64 amd64 ppc64le"
|
2019-12-18 08:29:57 +00:00
|
|
|
DOWNLOADS="kubelet kubectl kubeadm"
|
|
|
|
DOWNLOAD_DIR="tmp/kubeadm_hasher"
|
|
|
|
|
|
|
|
if [ -z "$VERSIONS" ]; then
|
|
|
|
echo "USAGE: $0 <versions>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p ${DOWNLOAD_DIR}
|
|
|
|
for download in ${DOWNLOADS}; do
|
|
|
|
echo -e "\n\n${download}_checksums:"
|
|
|
|
for arch in ${ARCHITECTURES}; do
|
|
|
|
echo -e " ${arch}:"
|
|
|
|
for version in ${VERSIONS}; do
|
|
|
|
TARGET="${DOWNLOAD_DIR}/${download}-$version-$arch"
|
|
|
|
if [ ! -f ${TARGET} ]; then
|
2020-03-27 06:12:23 +00:00
|
|
|
curl -L -f -S -s -o ${TARGET} "https://storage.googleapis.com/kubernetes-release/release/${version}/bin/linux/${arch}/${download}"
|
2019-12-18 08:29:57 +00:00
|
|
|
fi
|
|
|
|
echo -e " ${version}: $(sha256sum ${TARGET} | awk '{print $1}')"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
|
|
|
echo -e "\n\nAdd these values to roles/download/defaults/main.yml"
|