Support fetching NPD from github releases in standalone mode

We stop releasing NPD tar files to gs://kubernetes-release. This PR
changes it to pull from github release notes by default. It still
supports overriding the defaults and pulling from a GCS bucket,
which is used by NPD CI tests.
This commit is contained in:
Zhen Wang 2024-03-10 19:37:24 +00:00
parent 8f80e01467
commit 3ce6c104e2

View File

@ -295,9 +295,14 @@ function install-node-problem-detector {
return
fi
echo "Downloading ${npd_tar}."
local -r npd_release_path="${NODE_PROBLEM_DETECTOR_RELEASE_PATH:-https://storage.googleapis.com/kubernetes-release}"
download-or-bust "${npd_hash}" "${npd_release_path}/node-problem-detector/${npd_tar}"
if [[ -n "${NODE_PROBLEM_DETECTOR_RELEASE_PATH:-}" ]]; then
echo "Downloading ${npd_tar} from ${NODE_PROBLEM_DETECTOR_RELEASE_PATH}."
local -r download_path="${NODE_PROBLEM_DETECTOR_RELEASE_PATH}/node-problem-detector/${npd_tar}"
else
echo "Downloading ${npd_tar} from github."
local -r download_path="https://github.com/kubernetes/node-problem-detector/releases/download/${npd_version}/${npd_tar}"
fi
download-or-bust "${npd_hash}" "${download_path}"
local -r npd_dir="${KUBE_HOME}/node-problem-detector"
mkdir -p "${npd_dir}"
tar xzf "${KUBE_HOME}/${npd_tar}" -C "${npd_dir}" --overwrite