|
3 | 3 | out="| Argo CD version | Kubernetes versions |\n"
|
4 | 4 | out+="|-----------------|---------------------|\n"
|
5 | 5 |
|
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]+\.//') |
9 | 9 |
|
10 |
| -minor_version_decrement=0 |
11 | 10 | 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 |
15 | 13 |
|
16 | 14 | line=$(yq '.jobs["test-e2e"].strategy.matrix |
|
17 | 15 | # k3s-version was an array prior to 2.12. This checks for the old format first and then falls back to the new format.
|
18 | 16 | (.["k3s-version"] // (.k3s | map(.version))) |
|
19 | 17 | .[]' .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) | \(.) |"') |
22 | 20 | out+="$line\n"
|
23 | 21 |
|
24 |
| - minor_version_decrement=$((minor_version_decrement + 1)) |
25 | 22 |
|
26 | 23 | # If we're at minor version 0, there's no further version back in this series. Instead, move to the latest version in
|
27 | 24 | # the previous major release series.
|
28 | 25 | if [ "$argocd_minor_version_num" -eq 0 ]; then
|
29 | 26 | argocd_major_version_num=$((argocd_major_version_num - 1))
|
30 | 27 | # Get the latest minor version in the previous series.
|
31 | 28 | 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)) |
36 | 31 | fi
|
37 | 32 | done
|
38 | 33 |
|
39 |
| -git checkout "release-$argocd_minor_version" |
| 34 | +git checkout "release-$argocd_current_version" |
40 | 35 |
|
41 | 36 | printf "$out" > docs/operator-manual/tested-kubernetes-versions.md
|
0 commit comments