Skip to content

Commit 200dc1d

Browse files
ci: fix supported-version script (cherry-pick #23496) (#23497)
Signed-off-by: Alexandre Gaudreault <[email protected]> Co-authored-by: Alexandre Gaudreault <[email protected]>
1 parent 3f1d9bf commit 200dc1d

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

hack/update-supported-versions.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,34 @@
33
out="| Argo CD version | Kubernetes versions |\n"
44
out+="|-----------------|---------------------|\n"
55

6-
argocd_minor_version=$(git rev-parse --abbrev-ref HEAD | sed 's/release-//')
7-
argocd_major_version_num=$(echo "$argocd_minor_version" | sed -E 's/\.[0-9]+//')
8-
argocd_minor_version_num=$(echo "$argocd_minor_version" | sed -E 's/[0-9]+\.//')
6+
argocd_current_version=$(git rev-parse --abbrev-ref HEAD | sed 's/release-//')
7+
argocd_major_version_num=$(echo "$argocd_current_version" | sed -E 's/\.[0-9]+//')
8+
argocd_minor_version_num=$(echo "$argocd_current_version" | sed -E 's/[0-9]+\.//')
99

10-
minor_version_decrement=0
1110
for _ in {1..3}; do
12-
minor_version_num=$((argocd_minor_version_num - minor_version_decrement))
13-
minor_version="${argocd_major_version_num}.${minor_version_num}"
14-
git checkout "release-$minor_version" > /dev/null || exit 1
11+
argocd_version="${argocd_major_version_num}.${argocd_minor_version_num}"
12+
git checkout "release-$argocd_version" > /dev/null || exit 1
1513

1614
line=$(yq '.jobs["test-e2e"].strategy.matrix |
1715
# k3s-version was an array prior to 2.12. This checks for the old format first and then falls back to the new format.
1816
(.["k3s-version"] // (.k3s | map(.version))) |
1917
.[]' .github/workflows/ci-build.yaml | \
20-
jq --arg minor_version "$minor_version" --raw-input --slurp --raw-output \
21-
'split("\n")[:-1] | map(sub("\\.[0-9]+$"; "")) | join(", ") | "| \($minor_version) | \(.) |"')
18+
jq --arg argocd_version "$argocd_version" --raw-input --slurp --raw-output \
19+
'split("\n")[:-1] | map(sub("\\.[0-9]+$"; "")) | join(", ") | "| \($argocd_version) | \(.) |"')
2220
out+="$line\n"
2321

24-
minor_version_decrement=$((minor_version_decrement + 1))
2522

2623
# If we're at minor version 0, there's no further version back in this series. Instead, move to the latest version in
2724
# the previous major release series.
2825
if [ "$argocd_minor_version_num" -eq 0 ]; then
2926
argocd_major_version_num=$((argocd_major_version_num - 1))
3027
# Get the latest minor version in the previous series.
3128
argocd_minor_version_num=$(git tag -l "v$argocd_major_version_num.*" | sort -V | tail -n 1 | sed -E 's/\.[0-9]+$//' | sed -E 's/^v[0-9]+\.//')
32-
33-
# Don't decrement the minor version, since we're switching to the previous major release series. We want the latest
34-
# minor version in that series.
35-
minor_version_decrement=0
29+
else
30+
argocd_minor_version_num=$((argocd_minor_version_num - 1))
3631
fi
3732
done
3833

39-
git checkout "release-$argocd_minor_version"
34+
git checkout "release-$argocd_current_version"
4035

4136
printf "$out" > docs/operator-manual/tested-kubernetes-versions.md

0 commit comments

Comments
 (0)