From c24355e66614a3bdeabc4ef70a443fe61fff44f6 Mon Sep 17 00:00:00 2001 From: Yang Chiu Date: Wed, 20 Dec 2023 10:46:32 +0800 Subject: [PATCH] ci: install different version of external-snapshotter based on longhorn-images.txt Signed-off-by: Yang Chiu --- test_framework/scripts/longhorn-setup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test_framework/scripts/longhorn-setup.sh b/test_framework/scripts/longhorn-setup.sh index ab3149d6c3..ea536c06b7 100755 --- a/test_framework/scripts/longhorn-setup.sh +++ b/test_framework/scripts/longhorn-setup.sh @@ -56,9 +56,13 @@ install_cluster_autoscaler(){ install_csi_snapshotter_crds(){ CSI_SNAPSHOTTER_REPO_URL="https://github.com/kubernetes-csi/external-snapshotter.git" - CSI_SNAPSHOTTER_REPO_BRANCH="v6.2.1" CSI_SNAPSHOTTER_REPO_DIR="${TMPDIR}/k8s-csi-external-snapshotter" + [[ "${LONGHORN_REPO_URL}" =~ https://([^/]+)/([^/]+)/([^/.]+)(.git)? ]] + wget "https://raw.githubusercontent.com/${BASH_REMATCH[2]}/${BASH_REMATCH[3]}/${LONGHORN_REPO_BRANCH}/deploy/longhorn-images.txt" -O "/tmp/longhorn-images.txt" + IFS=: read -ra IMAGE_TAG_PAIR <<< $(grep csi-snapshotter /tmp/longhorn-images.txt) + CSI_SNAPSHOTTER_REPO_BRANCH="${IMAGE_TAG_PAIR[1]}" + git clone --single-branch \ --branch "${CSI_SNAPSHOTTER_REPO_BRANCH}" \ "${CSI_SNAPSHOTTER_REPO_URL}" \