diff --git a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e-step-template.yaml b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e-step-template.yaml index c758c74f10..a7c3d5a380 100644 --- a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e-step-template.yaml +++ b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e-step-template.yaml @@ -53,25 +53,7 @@ steps: name: "installCilium" displayName: "Install Cilium on AKS Overlay" - - script: | - echo "install cilium CLI" - if [[ ${CILIUM_VERSION_TAG_V1_4} =~ ^1.1[1-3].[0-9]{1,2} ]]; then - echo "Cilium Agent Version ${BASH_REMATCH[0]}" - CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt) - else - echo "Cilium Agent Version ${CILIUM_VERSION_TAG_V1_4}" - CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt) - fi - CLI_ARCH=amd64 - if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi - curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} - sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum - sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin - rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} - cilium status - cilium version - name: "installCiliumCLI" - displayName: "Install Cilium CLI" + - template: ../../templates/cilium-cli.yaml - script: | echo "Start Azilium E2E Tests on Overlay Cluster" diff --git a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml index fce1f8be31..df06fbcdae 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml @@ -50,25 +50,7 @@ steps: name: "installCilium" displayName: "Install Cilium" - - script: | - echo "install cilium CLI" - if [[ ${CILIUM_VERSION_TAG_V1_4} =~ ^1.1[1-3].[0-9]{1,2} ]]; then - echo "Cilium Agent Version ${BASH_REMATCH[0]}" - CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt) - else - echo "Cilium Agent Version ${CILIUM_VERSION_TAG_V1_4}" - CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt) - fi - CLI_ARCH=amd64 - if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi - curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} - sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum - sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin - rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} - cilium status - cilium version - name: "installCiliumCLI" - displayName: "Install Cilium CLI" + - template: ../../templates/cilium-cli.yaml - script: | echo "Start Azilium E2E Tests" diff --git a/.pipelines/templates/cilium-cli.yaml b/.pipelines/templates/cilium-cli.yaml new file mode 100644 index 0000000000..d2dc0ed6cf --- /dev/null +++ b/.pipelines/templates/cilium-cli.yaml @@ -0,0 +1,23 @@ +steps: + - script: | + echo "install cilium CLI" + if [[ ${CILIUM_VERSION_TAG_V1_4#v} =~ ^1.1[1-3].[0-9]{1,2}|1.1[1-3].[0-9]{1,2}-[0-9]{1,6} ]]; then + echo "Cilium Agent Version ${BASH_REMATCH[0]}" + CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt) + elif [[ ${CILIUM_VERSION_TAG_V1_4#v} =~ ^1.1[1-4].[0-9]{1,2}|1.1[1-4].[0-9]{1,2}-[0-9]{1,6} ]]; then + echo "Cilium Agent Version ${BASH_REMATCH[0]}" + CILIUM_CLI_VERSION=v0.15.22 + else + echo "Cilium Agent Version ${CILIUM_VERSION_TAG_V1_4}" + CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt) + fi + CLI_ARCH=amd64 + if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi + curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} + sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum + sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin + rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} + cilium status + cilium version + name: "installCiliumCLI" + displayName: "Install Cilium CLI"