mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Rework npd default hash selection to match crictl
Change-Id: I63e0837e62c4c8fa5d8371dcb1390d2d3e672e0c
This commit is contained in:
parent
9288c190f9
commit
01b8d59430
@ -263,24 +263,29 @@ function install-gci-mounter-tools {
|
|||||||
|
|
||||||
# Install node problem detector binary.
|
# Install node problem detector binary.
|
||||||
function install-node-problem-detector {
|
function install-node-problem-detector {
|
||||||
if [[ "${HOST_ARCH}" == "amd64" ]]; then
|
|
||||||
DEFAULT_NPD_HASH=${DEFAULT_NPD_HASH_AMD64}
|
|
||||||
elif [[ "${HOST_ARCH}" == "arm64" ]]; then
|
|
||||||
DEFAULT_NPD_HASH=${DEFAULT_NPD_HASH_ARM64}
|
|
||||||
else
|
|
||||||
# no other architectures are supported currently.
|
|
||||||
# Assumption is that this script only runs on linux,
|
|
||||||
# see cluster/gce/windows/k8s-node-setup.psm1 for windows
|
|
||||||
# https://github.com/kubernetes/node-problem-detector/releases/
|
|
||||||
DEFAULT_NPD_HASH='N/A'
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n "${NODE_PROBLEM_DETECTOR_VERSION:-}" ]]; then
|
if [[ -n "${NODE_PROBLEM_DETECTOR_VERSION:-}" ]]; then
|
||||||
local -r npd_version="${NODE_PROBLEM_DETECTOR_VERSION}"
|
local -r npd_version="${NODE_PROBLEM_DETECTOR_VERSION}"
|
||||||
local -r npd_hash="${NODE_PROBLEM_DETECTOR_TAR_HASH}"
|
local -r npd_hash="${NODE_PROBLEM_DETECTOR_TAR_HASH}"
|
||||||
else
|
else
|
||||||
local -r npd_version="${DEFAULT_NPD_VERSION}"
|
local -r npd_version="${DEFAULT_NPD_VERSION}"
|
||||||
local -r npd_hash="${DEFAULT_NPD_HASH}"
|
case "${HOST_PLATFORM}/${HOST_ARCH}" in
|
||||||
|
linux/amd64)
|
||||||
|
local -r npd_hash="${DEFAULT_NPD_HASH_AMD64}"
|
||||||
|
;;
|
||||||
|
linux/arm64)
|
||||||
|
local -r npd_hash="${DEFAULT_NPD_HASH_ARM64}"
|
||||||
|
;;
|
||||||
|
# no other architectures are supported currently.
|
||||||
|
# Assumption is that this script only runs on linux,
|
||||||
|
# see cluster/gce/windows/k8s-node-setup.psm1 for windows
|
||||||
|
# https://github.com/kubernetes/node-problem-detector/releases/
|
||||||
|
*)
|
||||||
|
echo "Unrecognized version and platform/arch combination:"
|
||||||
|
echo "$DEFAULT_NPD_VERSION $HOST_PLATFORM/$HOST_ARCH"
|
||||||
|
echo "Set NODE_PROBLEM_DETECTOR_VERSION and NODE_PROBLEM_DETECTOR_TAR_HASH to overwrite"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
local -r npd_tar="node-problem-detector-${npd_version}-${HOST_PLATFORM}_${HOST_ARCH}.tar.gz"
|
local -r npd_tar="node-problem-detector-${npd_version}-${HOST_PLATFORM}_${HOST_ARCH}.tar.gz"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user