diff --git a/test/e2e/files/Vagrantfile.in b/test/e2e/files/Vagrantfile.in index 4bb3f4a32..7afea5189 100644 --- a/test/e2e/files/Vagrantfile.in +++ b/test/e2e/files/Vagrantfile.in @@ -29,6 +29,7 @@ else end CNI_PLUGIN = "#{ENV['cni_plugin']}" +CNI_RELEASE = "#{ENV['cni_release']}" NRI_RESOURCE_POLICY_SRC = "#{ENV['nri_resource_policy_src']}" OUTPUT_DIR = "#{ENV['OUTPUT_DIR']}" @@ -93,6 +94,7 @@ Vagrant.configure("2") do |config| crio_release: CRIO_RELEASE, crio_src: CRIO_SRC, cni_plugin: CNI_PLUGIN, + cni_release: CNI_RELEASE, nri_resource_policy_src: NRI_RESOURCE_POLICY_SRC, outdir: OUTPUT_DIR, } diff --git a/test/e2e/playbook/provision.yaml b/test/e2e/playbook/provision.yaml index db9bf0db2..cebd93af0 100644 --- a/test/e2e/playbook/provision.yaml +++ b/test/e2e/playbook/provision.yaml @@ -13,7 +13,8 @@ - crio_tarball: "https://storage.googleapis.com/cri-o/artifacts/cri-o.amd64.v{{ crio_release }}.tar.gz" - dns_nameserver: "{{ dns_nameserver }}" - cni_plugin: "{{ cni_plugin }}" - + - cni_release: "{{ cni_release }}" + - cilium_tarball: "" tasks: - set_fact: @@ -334,19 +335,30 @@ - kubectl taint nodes --all node-role.kubernetes.io/control-plane- || true - kubectl taint nodes --all node-role.kubernetes.io/master- || true - - block: - - name: Fetch and extract cilium (installer) release tarball - ansible.builtin.unarchive: - src: "https://github.com/cilium/cilium-cli/releases/latest/download/cilium-linux-amd64.tar.gz" - dest: /usr/local/bin - remote_src: yes - - - name: Run cilium installer - ansible.builtin.shell: "{{ item }}" - with_items: - - cilium install --wait - - cilium status --wait + - name: Install cilium CNI plugin when: cni_plugin == "cilium" + block: + - name: "Use irregular download path if cilium release is latest" + when: cni_release == "latest" + ansible.builtin.set_fact: + cilium_tarball: https://github.com/cilium/cilium-cli/releases/latest/download/cilium-linux-amd64.tar.gz + + - name: "Use regular download path if cilium release is not latest" + when: cni_release != "latest" + ansible.builtin.set_fact: + cilium_tarball: https://github.com/cilium/cilium-cli/releases/download/{{ cni_release }}/cilium-linux-amd64.tar.gz + + - name: "Fetch and extract {{ cni_release }} cilium (installer) release tarball" + ansible.builtin.unarchive: + src: "{{ cilium_tarball }}" + dest: /usr/local/bin + remote_src: true + + - name: Run cilium installer + ansible.builtin.command: "{{ item }}" + with_items: + - cilium install --wait + - cilium status --wait - block: - name: Copy CNI bridge plugin configuration diff --git a/test/e2e/run.sh b/test/e2e/run.sh index 34d69e3c6..8408e1631 100755 --- a/test/e2e/run.sh +++ b/test/e2e/run.sh @@ -20,6 +20,7 @@ export COMMAND_OUTPUT_DIR="$TEST_OUTPUT_DIR"/commands distro=${distro:-$DEFAULT_DISTRO} export k8scri=${k8scri:-"containerd"} export cni_plugin=${cni_plugin:-cilium} +export cni_release=${cni_release:-latest} TOPOLOGY_DIR=${TOPOLOGY_DIR:=e2e} source "$LIB_DIR"/vm.bash