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.31] Backports for 2025-02 #11732

Merged
merged 31 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
889bf5f
Align etcd-snapshot-dir default path description
majabojarska Jan 11, 2025
a8e648d
chore: Bump klipper-lb and klipper-helm (#11595)
dereknola Jan 16, 2025
911ab5b
Disable s3 transport transparent compression/decompression
brandond Jan 14, 2025
b1b3de6
Bump spegel to v0.0.30
brandond Jan 21, 2025
474c16a
Update p2p boostrap helpers for Spegel v0.0.30
brandond Jan 22, 2025
9f2d304
Bump Local Path Provisioner version (#11657)
github-actions[bot] Jan 27, 2025
cd46a53
Add support for AWS shared credentials file
brandond Jan 15, 2025
ac47540
Bump kine to v0.13.8
brandond Jan 29, 2025
b717db4
Bump etcd to v3.5.18
brandond Jan 29, 2025
db4aa5a
Consolidate linux and windows containerd config templates
brandond Feb 4, 2025
b9e01d5
Move Windows compilation test to GH Actions and enable integration/co…
brandond Feb 5, 2025
18cd2b9
Make intermediate bin tarball os-specific
brandond Feb 6, 2025
1c108b1
Bump kine for no-sqlite build fix
brandond Feb 6, 2025
5b50cbb
Wait for docker to start before running dapper
brandond Feb 5, 2025
c3570e8
Fix linux-specific clientaccess test
brandond Feb 5, 2025
099cd52
Make etcd test linux-only
brandond Feb 6, 2025
ea91bf3
Remove broken unused windows test
brandond Feb 5, 2025
9390f79
Replace hardcoded unix-style paths in test
brandond Feb 5, 2025
1ecda90
Fix permissions checks on windows
brandond Feb 6, 2025
e20421a
Fix containerd hosts.toml path on windows
brandond Feb 6, 2025
4e7fb46
Fix windows path quoting/escaping in containerd config template
brandond Feb 6, 2025
8bc1c1f
Add missing windows runtime type definition
brandond Feb 6, 2025
08eb530
Fix default pause image on windows
brandond Feb 6, 2025
72e79d5
Add linux nodeSelector to local-storage and metrics-server
brandond Feb 6, 2025
5db74a0
Skip netpol startup on windows instead of panicing
brandond Feb 6, 2025
1f83584
Add windows smoke test
brandond Feb 6, 2025
bb49500
Fix wasm ingress test
brandond Feb 4, 2025
9803d60
Upgrade containerd to v2.0.2
brandond Jan 16, 2025
52caa49
Update containerd config schema to version 3
brandond Jan 17, 2025
9d27c4e
Move windows build to separate job
brandond Feb 7, 2025
5a5faec
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*
26 changes: 26 additions & 0 deletions .github/workflows/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,29 @@ jobs:
with:
## If no one connects after 5 minutes, shut down server.
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