diff --git a/.github/actions/install-kubectl/action.yaml b/.github/actions/install-kubectl/action.yaml index ca426e9f9c8..55a1f091a0a 100644 --- a/.github/actions/install-kubectl/action.yaml +++ b/.github/actions/install-kubectl/action.yaml @@ -1,16 +1,29 @@ name: Install kubectl description: Downloads kubectl and installs it locally. Follows the instructions for Debian-based distributions at https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management. +inputs: + k8s_version: + description: 'The version of Kubernetes to install. For example, 1.28.7.' + required: true runs: using: "composite" steps: + - name: Parse K8s minor version + id: parse_k8s_minor_version + shell: bash + run: | + split=( ${{ inputs.k8s_version//./ }} ) + k8s_minor_version=${split[0]}.${split[1]} + + echo Using K8s minor version ${k8s_minor_version} + echo "k8s_minor_version=${k8s_minor_version}" >> $GITHUB_OUTPUT - name: Download the public signing key for the Kubernetes package repositories shell: bash run: | - curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg + curl -fsSL https://pkgs.k8s.io/core:/stable:/v${{ steps.parse_k8s_minor_version.outputs.k8s_minor_version }}/deb/Release.key | sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg - name: Add the appropriate Kubernetes apt repository shell: bash run: | - echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list + echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v${{ steps.parse_k8s_minor_version.outputs.k8s_minor_version }}/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list - name: Install kubectl shell: bash run: | diff --git a/.github/actions/setup-tools/action.yaml b/.github/actions/setup-tools/action.yaml index 13cdf47a03b..62a90c70276 100644 --- a/.github/actions/setup-tools/action.yaml +++ b/.github/actions/setup-tools/action.yaml @@ -1,6 +1,12 @@ name: Setup tools description: Downloads, installs and configures all the tools needed to setup and run the tests. +inputs: + k8s_version: + description: 'The version of Kubernetes to install. For example, 1.28.7.' + required: true runs: using: "composite" steps: - uses: ./.github/actions/install-kubectl + with: + k8s_version: ${{ inputs.k8s_version }} diff --git a/.github/workflows/test-e2e-junk.yaml b/.github/workflows/test-e2e-junk.yaml index 497c015100d..06a21ff9d8f 100644 --- a/.github/workflows/test-e2e-junk.yaml +++ b/.github/workflows/test-e2e-junk.yaml @@ -16,6 +16,10 @@ jobs: e2e-integration: needs: wait-for-image-build runs-on: ubuntu-latest + env: + K8S_VERSION: 1.28.7 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-tools + with: + k8s_version: ${{ env.K8S_VERSION }}