From 886b11bf1ddda152d1e7248eb2eeffb0cd7e2a38 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Thu, 13 Jan 2022 11:10:35 +0100 Subject: [PATCH] .github: find latest calico tag from tigera operator The mirror-calico workflow has been failing because it currently determines version=v3.22.0-0.dev-typha, which is not the tag used by the individual container images. Rewrite the version logic to determine the version based on what is in the tigera operator manifest. This is the same manifest that we use to deploy calico in mantle. Signed-off-by: Jeremi Piotrowski --- .../.github/workflows/mirror-calico.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/mirror-calico.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/mirror-calico.yml index 4d64e09d2a..016640df6e 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/mirror-calico.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/mirror-calico.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - get-docker-release: + mirror-calico: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -17,10 +17,19 @@ jobs: run: | set -ex - git clone https://github.com/projectcalico/calico calico - # get latest version - version=$(git -C "$_" tag | sort -V | tail -1) + tigera_image=$(curl -sSL https://docs.projectcalico.org/manifests/tigera-operator.yaml \ + | awk '/image:/ && NF == 2 { print $2 }') + tigera_version=${tigera_image##*:} + + versions=$(curl -sSL "https://raw.githubusercontent.com/tigera/operator/${tigera_version}/config/calico_versions.yml" \ + | awk '/version:/ { print $2 }' \ + | sort \ + | uniq) + + echo "Found versions: $versions" pushd .github/workflows/ - ./mirror-calico.sh $version + for version in $versions; do + ./mirror-calico.sh $version + done popd