github.com/argoproj/argo-cd/v3@v3.2.1/hack/update-supported-versions.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  out="| Argo CD version | Kubernetes versions |\n"
     4  out+="|-----------------|---------------------|\n"
     5  
     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  
    10  for _ in {1..3}; do
    11    argocd_version="${argocd_major_version_num}.${argocd_minor_version_num}"
    12    git checkout "release-$argocd_version" > /dev/null || exit 1
    13  
    14    line=$(yq '.jobs["test-e2e"].strategy.matrix |
    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.
    16      (.["k3s-version"] // (.k3s | map(.version))) |
    17      .[]' .github/workflows/ci-build.yaml | \
    18      jq --arg argocd_version "$argocd_version" --raw-input --slurp --raw-output \
    19      'split("\n")[:-1] | map(sub("\\.[0-9]+$"; "")) | join(", ") | "| \($argocd_version) | \(.) |"')
    20    out+="$line\n"
    21  
    22  
    23    # If we're at minor version 0, there's no further version back in this series. Instead, move to the latest version in
    24    # the previous major release series.
    25    if [ "$argocd_minor_version_num" -eq 0 ]; then
    26      argocd_major_version_num=$((argocd_major_version_num - 1))
    27      # Get the latest minor version in the previous series.
    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]+\.//')
    29    else
    30      argocd_minor_version_num=$((argocd_minor_version_num - 1))
    31    fi
    32  done
    33  
    34  git checkout "release-$argocd_current_version"
    35  
    36  echo -en "$out" > docs/operator-manual/tested-kubernetes-versions.md