From 8cbdb48d6dfa1d522e5f203a4c91a50d4ab77f01 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Wed, 11 Mar 2026 11:37:36 -0700 Subject: [PATCH] Move k3s version control into testing CI (#523) Signed-off-by: Derek Nola --- .github/workflows/integration.yml | 14 ++++++++++---- tests/basic.yml | 1 + tests/notoken.yml | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 64daeca..62463b9 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -16,7 +16,9 @@ jobs: exclude: - service_mgr: openrc inventory: notoken - + env: + STARTING_K3S_VERSION: v1.34.3+k3s1 + UPGRADE_K3S_VERSION: v1.35.1+k3s1 # K3s requires privileged containers to run inside Docker and access to cgrougs. steps: - name: Set container OS based on service manager @@ -88,6 +90,10 @@ jobs: docker exec server-node apk add curl python3 docker exec agent-node apk add curl python3 + - name: Replace k3s_version in inventory + run: | + sed -i "s/k3s_version: .*/k3s_version: ${STARTING_K3S_VERSION}/" tests/${{ matrix.inventory }}.yml + - name: Run Playbook env: ANSIBLE_FORCE_COLOR: '1' @@ -121,16 +127,16 @@ jobs: - name: Modify the k3s_version in inventory for upgrade run: | - sed -i 's/k3s_version: v1.33.4+k3s1/k3s_version: v1.34.1+k3s1/' tests/${{ matrix.inventory }}.yml + sed -i "s/k3s_version: .*/k3s_version: ${UPGRADE_K3S_VERSION}/" tests/${{ matrix.inventory }}.yml - name: Run Upgrade Playbook run: ansible-playbook playbooks/upgrade.yml -i tests/${{ matrix.inventory }}.yml - name: Verify K3s upgraded on Server - run: docker exec server-node k3s --version | grep v1.34. + run: docker exec server-node k3s --version | grep ${UPGRADE_K3S_VERSION} - name: Verify K3s upgraded on Agent - run: docker exec agent-node k3s --version | grep v1.34. + run: docker exec agent-node k3s --version | grep ${UPGRADE_K3S_VERSION} - name: Wait for all deployments to be ready run: | diff --git a/tests/basic.yml b/tests/basic.yml index f95fcd0..406141b 100644 --- a/tests/basic.yml +++ b/tests/basic.yml @@ -11,6 +11,7 @@ k3s_cluster: ansible_connection: docker ansible_user: root ansible_become: true + # The version here is an abitrary example and is replaced/set in the testing workflow k3s_version: v1.33.4+k3s1 token: "secret12345" api_endpoint: "server-node" diff --git a/tests/notoken.yml b/tests/notoken.yml index 1939d0b..2238f1b 100644 --- a/tests/notoken.yml +++ b/tests/notoken.yml @@ -11,6 +11,7 @@ k3s_cluster: ansible_connection: docker ansible_user: root ansible_become: true + # The version here is an abitrary example and is replaced/set in the testing workflow k3s_version: v1.33.4+k3s1 api_endpoint: "server-node" extra_server_args: "--snapshotter=native"