Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add step to get k3s latest version #2206

Merged
merged 8 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/actions/setup-e2e/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ runs:
with:
agents: 3
ingress_port: ${{ inputs.ingress_port }}
options: "--image docker.io/rancher/k3s:latest"
- name: Check Kubernetes cluster
shell: bash
run: |
Expand Down
16 changes: 16 additions & 0 deletions .github/actions/setup-k3d/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
description: "k3d version"
required: false
default: "latest"
k3s_version:
description: "The k3s to use. The default version is `versions/K3S_VERSION`"
required: false
default: ""
name:
description: "Cluster name"
required: false
Expand Down Expand Up @@ -52,6 +56,16 @@ runs:
env:
K3D_VERSION: ${{ inputs.version }}

- name: Detect k3s version
id: k3s_version
shell: bash
run: |
K3S_VERSION=${K3S_VERSION:-`cat versions/K3S_VERSION`}

echo "tag=${K3S_VERSION=$}" >> $GITHUB_OUTPUT
env:
K3S_VERSION: ${{ inputs.k3s_version }}

- name: Install k3d
shell: bash
run: |
Expand All @@ -74,11 +88,13 @@ runs:
if [ "${INGRESS_PORT}" != 0 ]; then
OPTIONS="${OPTIONS} -p ${INGRESS_PORT}:80@loadbalancer"
fi
OPTIONS="${OPTIONS} --image rancher/k3s:${K3S_VERSION}"
echo "options=${OPTIONS}" >> $GITHUB_OUTPUT
env:
AGENTS: ${{ inputs.agents }}
INGRESS_PORT: ${{ inputs.ingress_port }}
OPTIONS: ${{ inputs.options }}
K3S_VERSION: ${{ steps.k3s_version.outputs.tag }}

- name: Create k8s cluster
shell: bash
Expand Down
8 changes: 7 additions & 1 deletion Makefile.d/dependencies.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ update/libs: \
update/helm-docs \
update/helm-operator \
update/jaeger-operator \
update/k3s \
update/kind \
update/kubectl \
update/kube-linter \
update/kubectl \
update/ngt \
update/prometheus-stack \
update/protobuf \
Expand Down Expand Up @@ -77,6 +78,11 @@ go/example/deps:
update/chaos-mesh:
curl --silent https://api.github.com/repos/chaos-mesh/chaos-mesh/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' | sed 's/v//g' > $(ROOTDIR)/versions/CHAOS_MESH_VERSION

.PHONY: update/k3s
## update k3s version
update/k3s:
curl --silent https://hub.docker.com/v2/repositories/rancher/k3s/tags | jq -r '.results[].name' | grep -E '.*-k3s1$$' | sort -V | tail -n 1 > $(ROOTDIR)/versions/K3S_VERSION

.PHONY: update/go
## update go version
update/go:
Expand Down
1 change: 1 addition & 0 deletions versions/K3S_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.28.2-k3s1
Loading