Skip to content

Commit

Permalink
Expand testing of k8s versions
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinbunney committed Nov 27, 2024
1 parent 135ea52 commit 81f21b5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ jobs:
run: make test

testacc:
strategy:
matrix:
k3s_version:
- v1.31.2-k3s1
- v1.29.10-k3s1
- v1.27.16-k3s1
- v1.25.16-k3s4
runs-on: ubuntu-latest
env:
GO111MODULE: on
Expand All @@ -61,6 +68,8 @@ jobs:
run: make ci-build-setup
- name: Start k3s
run: make k3s-start
env:
K3S_VERSION: ${{ matrix.k3s_version }}
- name: Run acceptance tests
run: make testacc
- name: Stop k3s
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
paths:
- '.github/workflows/docker.yml'

env:
IMAGES: "rancher/k3s:v1.31.2-k3s1,rancher/k3s:v1.29.10-k3s1,rancher/k3s:v1.27.16-k3s1,rancher/k3s:v1.25.16-k3s4,registry:2"

jobs:
cache-images:
strategy:
Expand Down
4 changes: 2 additions & 2 deletions scripts/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
server:
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-rancher-k3s:v1.31.2-k3s1-${ARCH:-amd64}
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-rancher-k3s:${K3S_VERSION}-${ARCH}
command: server --disable-agent --tls-san 172.17.0.1 --agent-token somethingtotallyrandom
privileged: true
environment:
Expand All @@ -20,7 +20,7 @@ services:
- 6443:6443

node:
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-rancher-k3s:v1.31.2-k3s1-${ARCH:-amd64}
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-rancher-k3s:${K3S_VERSION}-${ARCH}
command: agent --token somethingtotallyrandom --server https://server:6443
privileged: true
restart: always
Expand Down
2 changes: 2 additions & 0 deletions scripts/start-k3s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export COMPOSE_PROJECT_NAME=k3s
export ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
export DOCKER_DEFAULT_PLATFORM=linux/${ARCH}

export K3S_VERSION=${K3S_VERSION:-v1.31.2-k3s1}

echo "--> Tearing down k3s in docker-compose"
docker-compose down -v &>/dev/null || true
rm -rf ${KUBECONFIG}
Expand Down
2 changes: 2 additions & 0 deletions scripts/stop-k3s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export COMPOSE_PROJECT_NAME=k3s
export ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
export DOCKER_DEFAULT_PLATFORM=linux/${ARCH}

export K3S_VERSION=${K3S_VERSION:-v1.31.2-k3s1}

echo "--> Stopping k3s in docker-compose"
docker-compose down -v
rm -rf kubeconfig.yaml

0 comments on commit 81f21b5

Please sign in to comment.