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

[release-1.30] Backports for 2025-02 #11737

Merged
merged 29 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7b43d12
Align etcd-snapshot-dir default path description
majabojarska Jan 11, 2025
fb1860f
chore: Bump klipper-lb and klipper-helm (#11595)
dereknola Jan 16, 2025
8bbf37a
Disable s3 transport transparent compression/decompression
brandond Jan 14, 2025
a831ab5
Bump spegel to v0.0.30
brandond Jan 21, 2025
b808654
Update p2p boostrap helpers for Spegel v0.0.30
brandond Jan 22, 2025
5935ac2
Bump Local Path Provisioner version (#11657)
github-actions[bot] Jan 27, 2025
a06b833
Add support for AWS shared credentials file
brandond Jan 15, 2025
e8c82c3
Bump kine to v0.13.8
brandond Jan 29, 2025
8fe03d7
Bump etcd to v3.5.18
brandond Jan 29, 2025
e02bf04
Consolidate linux and windows containerd config templates
brandond Feb 4, 2025
aeb8c40
Move Windows compilation test to GH Actions and enable integration/co…
brandond Feb 5, 2025
60444c0
Make intermediate bin tarball os-specific
brandond Feb 6, 2025
0b34c15
Bump kine for no-sqlite build fix
brandond Feb 6, 2025
d0cfcc4
Wait for docker to start before running dapper
brandond Feb 5, 2025
1fa6150
Fix linux-specific clientaccess test
brandond Feb 5, 2025
4ea0830
Make etcd test linux-only
brandond Feb 6, 2025
4603ce8
Remove broken unused windows test
brandond Feb 5, 2025
e92d874
Replace hardcoded unix-style paths in test
brandond Feb 5, 2025
857b82f
Fix permissions checks on windows
brandond Feb 6, 2025
4f36be3
Fix containerd hosts.toml path on windows
brandond Feb 6, 2025
a3d1c1f
Fix windows path quoting/escaping in containerd config template
brandond Feb 6, 2025
ff10b25
Add missing windows runtime type definition
brandond Feb 6, 2025
af2a257
Fix default pause image on windows
brandond Feb 6, 2025
9aa4ca5
Add linux nodeSelector to local-storage and metrics-server
brandond Feb 6, 2025
f3a4a33
Skip netpol startup on windows instead of panicing
brandond Feb 6, 2025
1258a41
Add windows smoke test
brandond Feb 6, 2025
76a191e
Fix wasm ingress test
brandond Feb 4, 2025
49ec248
Move windows build to separate job
brandond Feb 7, 2025
cd42054
Fix FetchIngressIP error checking
brandond Feb 7, 2025
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
8 changes: 0 additions & 8 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ steps:
- name: docker
path: /var/run/docker.sock

- name: validate-cross-compilation
image: rancher/dapper:v0.6.0
commands:
- dapper validate-cross-compilation
volumes:
- name: docker
path: /var/run/docker.sock

- name: fossa
image: rancher/drone-fossa:latest
failure: ignore
Expand Down
36 changes: 19 additions & 17 deletions .github/workflows/build-k3s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
type: string
description: 'Architecture to build'
default: 'ubuntu-latest'
upload-repo:
type: boolean
required: false
default: false
upload-image:
type: boolean
required: false
Expand All @@ -34,22 +30,11 @@ jobs:
- name: Build K3s image
if: inputs.upload-image == true
run: make package-image
- name: bundle repo
if: inputs.upload-repo == true
run: |
tar -czvf ../k3s-repo.tar.gz .
mv ../k3s-repo.tar.gz .
- name: "Upload K3s directory"
if: inputs.upload-repo == true
uses: actions/upload-artifact@v4
with:
name: k3s-repo.tar.gz
path: k3s-repo.tar.gz
- name: "Save K3s image"
if: inputs.upload-image == true
run: docker image save rancher/k3s -o ./dist/artifacts/k3s-image.tar
- name: "Upload K3s Artifacts"
if: inputs.upload-repo == false && inputs.arch == 'ubuntu-latest'
if: inputs.arch == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: k3s
Expand All @@ -59,4 +44,21 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: k3s-arm64
path: dist/artifacts/k3s*
path: dist/artifacts/k3s*
build-windows:
name: Build (windows)
if: inputs.arch == 'ubuntu-latest'
runs-on: ${{ inputs.arch }} # defaults to ubuntu-latest, for arm64 use ubuntu-24.04-arm
timeout-minutes: 20
steps:
- name: Checkout K3s
uses: actions/checkout@v4
- name: Build K3s binary
run: |
DOCKER_BUILDKIT=1 SKIP_IMAGE=1 SKIP_AIRGAP=1 SKIP_VALIDATE=1 GOCOVER=1 GOOS=windows make
sha256sum dist/artifacts/k3s.exe | sed 's|dist/artifacts/||' > dist/artifacts/k3s.exe.sha256sum
- name: "Upload K3s Artifacts"
uses: actions/upload-artifact@v4
with:
name: k3s-windows
path: dist/artifacts/k3s*
36 changes: 35 additions & 1 deletion .github/workflows/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,45 @@ jobs:
run: vagrant provision --provision-with=k3s-status
- name: "k3s-procps"
run: vagrant provision --provision-with=k3s-procps
- name: "k3s-mount-directory"
run: vagrant provision --provision-with=k3s-mount-directory
- name: "k3s-uninstall"
run: vagrant provision --provision-with=k3s-uninstall
- name: "k3s-check-mount"
run: vagrant provision --provision-with=k3s-check-mount
- name: "k3s-unmount-dir"
run: vagrant provision --provision-with=k3s-unmount-dir
- name: Cleanup VM
run: vagrant destroy -f
- name: On Failure, launch debug session
uses: lhotari/action-upterm@v1
if: ${{ failure() }}
with:
## If no one connects after 5 minutes, shut down server.
wait-timeout-minutes: 5
wait-timeout-minutes: 5
test-windows:
name: "Smoke Test (windows)"
needs: build
runs-on: windows-2022
timeout-minutes: 10
steps:
- name: "Checkout"
uses: actions/checkout@v4
with: {fetch-depth: 1}
- name: "Download k3s binary"
uses: actions/download-artifact@v4
with:
name: k3s-windows
path: dist/artifacts/
- name: "Run K3s"
timeout-minutes: 5
run: |
$ErrorActionPreference = "Continue"
$PSNativeCommandUseErrorActionPreference = $true
$Server = Start-Job -ScriptBlock { ./dist/artifacts/k3s.exe server --token=token --embedded-registry --disable=metrics-server }
Start-Sleep -Seconds 15
D:/var/lib/rancher/k3s/data/current/bin/k3s.exe kubectl get node -o wide
D:/var/lib/rancher/k3s/data/current/bin/k3s.exe kubectl get pod -A -o wide
Stop-Job -Job $Server
Receive-Job -Wait -Job $Server
Remove-Job -Job $Server
30 changes: 26 additions & 4 deletions .github/workflows/unitcoverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ permissions:
contents: read

jobs:
test:
name: Unit Tests
test-unit-linux:
name: Unit Tests (linux)
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
Expand All @@ -38,8 +38,8 @@ jobs:
- name: Install Go
uses: ./.github/actions/setup-go
- name: Run Unit Tests
run: |
go test -coverpkg=./... -coverprofile=coverage.out ./pkg/... -run Unit
run: |
go test -coverpkg ./pkg/... -coverprofile coverage.out ./pkg/... -run Unit
go tool cover -func coverage.out
- name: On Failure, Launch Debug Session
if: ${{ failure() }}
Expand All @@ -53,3 +53,25 @@ jobs:
files: ./coverage.out
flags: unittests # optional
verbose: true # optional (default = false)
test-unit-windows:
name: Unit Tests (windows)
runs-on: windows-2022
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Go
uses: actions/setup-go@v5
- name: Run Unit Tests
run: |
go test -coverpkg ./pkg/... -coverprofile coverage.out ./pkg/... -run Unit
go tool cover -func coverage.out
- name: Upload Results To Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
flags: unittests # optional
verbose: true # optional (default = false)
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/image/go_build_agent
/image/main.squashfs
/package/k3s
/package/data.tar.zst
/package/data-*
/pkg/data/zz_generated_bindata.go
__pycache__
/tests/.pytest_cache/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ENV SELINUX=${SELINUX}

# Set Dapper configuration variables
ENV DAPPER_RUN_ARGS="--privileged -v k3s-cache:/go/src/github.com/k3s-io/k3s/.cache -v trivy-cache:/root/.cache/trivy" \
DAPPER_ENV="REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE SKIP_IMAGE SKIP_AIRGAP AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID GITHUB_TOKEN GOLANG GOCOVER DEBUG" \
DAPPER_ENV="REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE SKIP_IMAGE SKIP_AIRGAP AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID GITHUB_TOKEN GOLANG GOCOVER GOOS DEBUG" \
DAPPER_SOURCE="/go/src/github.com/k3s-io/k3s/" \
DAPPER_OUTPUT="./bin ./dist ./build/out ./build/static ./pkg/static ./pkg/deploy" \
DAPPER_DOCKER_SOCKET=true \
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
TARGETS := $(shell ls scripts | grep -v \\.sh)
GO_FILES ?= $$(find . -name '*.go' | grep -v generated)
SHELL := /bin/bash


.dapper:
Expand All @@ -9,7 +10,11 @@ GO_FILES ?= $$(find . -name '*.go' | grep -v generated)
@./.dapper.tmp -v
@mv .dapper.tmp .dapper

$(TARGETS): .dapper
.PHONY: docker.sock
docker.sock:
while ! docker version 1>/dev/null; do sleep 1; done

$(TARGETS): .dapper docker.sock
./.dapper $@

.PHONY: deps
Expand Down Expand Up @@ -42,4 +47,4 @@ format:
local:
DOCKER_BUILDKIT=1 docker build \
--build-arg="REPO TAG GITHUB_TOKEN GOLANG GOCOVER DEBUG" \
-t k3s-local -f Dockerfile.local --output=. .
-t k3s-local -f Dockerfile.local --output=. .
Loading
Loading