Skip to content

Commit e28c6ce

Browse files
committed
f
1 parent d03ef6b commit e28c6ce

File tree

9 files changed

+126
-49
lines changed

9 files changed

+126
-49
lines changed

.github/workflows/dependencies.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929
K0S_MINOR_VERSION=$(make print-K0S_MINOR_VERSION)
3030
fi
3131
echo "k0s minor version: $K0S_MINOR_VERSION"
32-
./scripts/k0s-update-dependencies.sh "$K0S_MINOR_VERSION"
32+
./scripts/k0s-update-dependencies.sh "$K0S_MINOR_VERSION" \
33+
UPDATE_ALL_IMAGES=true
3334
- name: Troubleshoot
3435
env:
3536
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/image-deps-updater.yaml

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
- cron: '0 4 * * *'
66
workflow_dispatch:
77
inputs:
8-
k0s_version:
9-
description: 'K0s version for discovering image versions'
8+
k0s_minor_version:
9+
description: 'K0s minor version for discovering image versions'
1010
required: false
1111
openebs_version:
1212
description: 'OpenEBS version for discovering image versions'
@@ -54,7 +54,6 @@ jobs:
5454
fail-fast: false
5555
matrix:
5656
addon:
57-
- k0s
5857
- openebs
5958
- velero
6059
- seaweedfs
@@ -73,7 +72,6 @@ jobs:
7372
IMAGES_REGISTRY_SERVER: index.docker.io
7473
IMAGES_REGISTRY_USER: ${{ secrets.DOCKERHUB_USER }}
7574
IMAGES_REGISTRY_PASS: ${{ secrets.DOCKERHUB_PASSWORD }}
76-
INPUT_K0S_VERSION: ${{ github.event.inputs.k0s_version }}
7775
INPUT_OPENEBS_VERSION: ${{ github.event.inputs.openebs_version }}
7876
INPUT_VELERO_VERSION: ${{ github.event.inputs.velero_version }}
7977
INPUT_VELERO_AWS_PLUGIN_VERSION: ${{ github.event.inputs.velero_aws_plugin_version }}
@@ -107,3 +105,53 @@ jobs:
107105
run: |
108106
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
109107
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
108+
109+
update-k0s-images:
110+
runs-on: ubuntu-latest
111+
steps:
112+
- name: Checkout
113+
uses: actions/checkout@v5
114+
115+
- name: Setup Go
116+
uses: actions/setup-go@v5
117+
with:
118+
go-version-file: go.mod
119+
cache-dependency-path: "**/*.sum"
120+
121+
- name: Update k0s images
122+
env:
123+
IMAGES_REGISTRY_SERVER: index.docker.io
124+
IMAGES_REGISTRY_USER: ${{ secrets.DOCKERHUB_USER }}
125+
IMAGES_REGISTRY_PASS: ${{ secrets.DOCKERHUB_PASSWORD }}
126+
ARCHS: "amd64,arm64"
127+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128+
run: |
129+
k0s_minor_version=$(make print-K0S_MINOR_VERSION)
130+
if [ -n "${{ github.event.inputs.k0s_minor_version }}" ]; then
131+
k0s_minor_version="${{ github.event.inputs.k0s_minor_version }}"
132+
fi
133+
./scripts/k0s-update-images.sh "$k0s_minor_version" \
134+
UPDATE_ALL_IMAGES=true
135+
136+
- name: Create Pull Request # creates a PR if there are differences
137+
uses: peter-evans/create-pull-request@v7
138+
id: cpr
139+
with:
140+
token: ${{ secrets.GH_PAT }}
141+
commit-message: 'Update image versions'
142+
title: "chore: update k0s images"
143+
branch: automation/k0s-image-dependencies
144+
delete-branch: true
145+
labels: |
146+
automated-pr
147+
images
148+
type::security
149+
draft: false
150+
base: ${{ github.ref_name }}
151+
body: "Automated changes by the [image-deps-updater](https://github.com/replicatedhq/embedded-cluster/blob/main/.github/workflows/image-deps-updater.yaml) GitHub action"
152+
153+
- name: Check outputs
154+
if: ${{ steps.cpr.outputs.pull-request-number }}
155+
run: |
156+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
157+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require (
2727
github.com/gorilla/mux v1.8.1
2828
github.com/gosimple/slug v1.15.0
2929
github.com/jedib0t/go-pretty/v6 v6.6.8
30-
github.com/k0sproject/k0s v1.33.4-0.20250721121212-4615902bc8c4
30+
github.com/k0sproject/k0s v1.33.5-0.20250819091818-6da1d9c31be6
3131
github.com/ohler55/ojg v1.26.9
3232
github.com/onsi/ginkgo/v2 v2.23.4
3333
github.com/onsi/gomega v1.38.0
@@ -300,7 +300,7 @@ require (
300300
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
301301
k8s.io/apiserver v0.33.4 // indirect
302302
k8s.io/component-base v0.33.4 // indirect
303-
k8s.io/kubelet v0.33.3 // indirect
303+
k8s.io/kubelet v0.33.4 // indirect
304304
k8s.io/metrics v0.33.4 // indirect
305305
oras.land/oras-go v1.2.6 // indirect
306306
periph.io/x/host/v3 v3.8.5 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,8 +1225,8 @@ github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+
12251225
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
12261226
github.com/k0sproject/dig v0.4.0 h1:yBxFUUxNXAMGBg6b7c6ypxdx/o3RmhoI5v5ABOw5tn0=
12271227
github.com/k0sproject/dig v0.4.0/go.mod h1:rlZ7N7ZEcB4Fi96TPXkZ4dqyAiDWOGLapyL9YpZ7Qz4=
1228-
github.com/k0sproject/k0s v1.33.4-0.20250721121212-4615902bc8c4 h1:Xj6IwJ9Xyf/eefwGVQnNr22/aC7t2PJ5BH5MNnROE6A=
1229-
github.com/k0sproject/k0s v1.33.4-0.20250721121212-4615902bc8c4/go.mod h1:ZZoTRuEVpxAokPb4t35P1O27iq+QYxvtSqRx6dzc82k=
1228+
github.com/k0sproject/k0s v1.33.5-0.20250819091818-6da1d9c31be6 h1:g5Jg/vHENLY1UnxDLkzcXLxxmSwLIxXIJNWlRAFPP6s=
1229+
github.com/k0sproject/k0s v1.33.5-0.20250819091818-6da1d9c31be6/go.mod h1:DUWIG4PCnk8w0muU+mlE5VZq2vvKrB//XBcYvHKVK54=
12301230
github.com/k0sproject/version v0.7.0 h1:pWp60UaA7N9g/wKUz1HN6heFW1M6ioWHEo8glHYlq00=
12311231
github.com/k0sproject/version v0.7.0/go.mod h1:iNV3O8blndsQhxZ8zACfpQhrLDlrTvDlCzx+vgCFtSI=
12321232
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
@@ -2461,8 +2461,8 @@ k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUy
24612461
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8=
24622462
k8s.io/kubectl v0.33.4 h1:nXEI6Vi+oB9hXxoAHyHisXolm/l1qutK3oZQMak4N98=
24632463
k8s.io/kubectl v0.33.4/go.mod h1:Xe7P9X4DfILvKmlBsVqUtzktkI56lEj22SJW7cFy6nE=
2464-
k8s.io/kubelet v0.33.3 h1:Cvy8+7Lq9saZds2ib7YBXbKvkMMJu3f5mzucmhSIJno=
2465-
k8s.io/kubelet v0.33.3/go.mod h1:Q1Cfr6VQq1m9v9XsE/mDmhTxPdN6NPU6Ug0e6mAqi58=
2464+
k8s.io/kubelet v0.33.4 h1:+sbpLmSq+Y8DF/OQeyw75OpuiF60tvlYcmc/yjN+nl4=
2465+
k8s.io/kubelet v0.33.4/go.mod h1:wboarviFRQld5rzZUjTliv7x00YVx+YhRd/p1OahX7Y=
24662466
k8s.io/metrics v0.33.4 h1:eJ6UdTpKTUQVZbKpUdm5ve39aPpAvvNwLrs13oQcWKc=
24672467
k8s.io/metrics v0.33.4/go.mod h1:NO/lgFtyIPTurz56debdSh5qRqRfpO8MlkMpau1Ue8U=
24682468
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=

kinds/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24.4
55
require (
66
github.com/google/uuid v1.6.0
77
github.com/k0sproject/dig v0.4.0
8-
github.com/k0sproject/k0s v1.33.4-0.20250721121212-4615902bc8c4
8+
github.com/k0sproject/k0s v1.33.5-0.20250819091818-6da1d9c31be6
99
github.com/stretchr/testify v1.10.0
1010
gopkg.in/yaml.v2 v2.4.0
1111
gopkg.in/yaml.v3 v3.0.1

kinds/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
3434
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
3535
github.com/k0sproject/dig v0.4.0 h1:yBxFUUxNXAMGBg6b7c6ypxdx/o3RmhoI5v5ABOw5tn0=
3636
github.com/k0sproject/dig v0.4.0/go.mod h1:rlZ7N7ZEcB4Fi96TPXkZ4dqyAiDWOGLapyL9YpZ7Qz4=
37-
github.com/k0sproject/k0s v1.33.4-0.20250721121212-4615902bc8c4 h1:Xj6IwJ9Xyf/eefwGVQnNr22/aC7t2PJ5BH5MNnROE6A=
38-
github.com/k0sproject/k0s v1.33.4-0.20250721121212-4615902bc8c4/go.mod h1:ZZoTRuEVpxAokPb4t35P1O27iq+QYxvtSqRx6dzc82k=
37+
github.com/k0sproject/k0s v1.33.5-0.20250819091818-6da1d9c31be6 h1:g5Jg/vHENLY1UnxDLkzcXLxxmSwLIxXIJNWlRAFPP6s=
38+
github.com/k0sproject/k0s v1.33.5-0.20250819091818-6da1d9c31be6/go.mod h1:DUWIG4PCnk8w0muU+mlE5VZq2vvKrB//XBcYvHKVK54=
3939
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
4040
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
4141
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=

scripts/k0s-update-dependencies.sh

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,6 @@ function generate_crd_manifests() {
3434
make -C operator manifests
3535
}
3636

37-
function update_k0s_metadata() {
38-
# if the metadata file for the minor version does not exist, copy it from the previous minor version
39-
if [ ! -f "./pkg/config/static/metadata-1_${K0S_MINOR_VERSION}.yaml" ]; then
40-
echo "metadata-1_${K0S_MINOR_VERSION}.yaml not found, copying from metadata-1_$((K0S_MINOR_VERSION - 1)).yaml"
41-
cp "./pkg/config/static/metadata-1_$((K0S_MINOR_VERSION - 1)).yaml" "./pkg/config/static/metadata-1_${K0S_MINOR_VERSION}.yaml"
42-
fi
43-
44-
make buildtools
45-
./output/bin/buildtools update images \
46-
--image kube-proxy --image pause \
47-
--image calico-cni --image calico-node --image calico-kube-controllers \
48-
k0s
49-
}
50-
5137
function main() {
5238
local minor_version=$1
5339
local minor_version_minus_1=$((minor_version - 1))
@@ -62,29 +48,13 @@ function main() {
6248
# pin to the current major.minor version
6349
sed "${SED_ARGS[@]}" "s/^K0S_MINOR_VERSION \?= .*$/K0S_MINOR_VERSION ?= $minor_version/" versions.mk
6450

65-
# substitute images for the major.minor version minus 2
66-
export K0S_MINOR_VERSION="$minor_version_minus_2"
67-
update_go_dependencies
68-
generate_crd_manifests
69-
update_k0s_metadata
70-
71-
# reset go.mod and go.sum
72-
git checkout -- **/go.mod **/go.sum
73-
74-
# substitute images for the major.minor version minus 1
75-
export K0S_MINOR_VERSION="$minor_version_minus_1"
76-
update_go_dependencies
77-
generate_crd_manifests
78-
update_k0s_metadata
79-
80-
# reset go.mod and go.sum
81-
git checkout -- **/go.mod **/go.sum
51+
# update images for all major.minor versions
52+
./scripts/k0s-update-images.sh "$minor_version"
8253

8354
# prepare the code for the current major.minor version
8455
export K0S_MINOR_VERSION="$minor_version"
8556
update_go_dependencies
8657
generate_crd_manifests
87-
update_k0s_metadata
8858

8959
echo "Done"
9060
}

scripts/k0s-update-images.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
UPDATE_ALL_IMAGES=${UPDATE_ALL_IMAGES:-false}
6+
7+
function update_go_dependencies() {
8+
make go.mod
9+
}
10+
11+
function update_k0s_metadata() {
12+
# if the metadata file for the minor version does not exist, copy it from the previous minor version
13+
if [ ! -f "./pkg/config/static/metadata-1_${K0S_MINOR_VERSION}.yaml" ]; then
14+
echo "metadata-1_${K0S_MINOR_VERSION}.yaml not found, copying from metadata-1_$((K0S_MINOR_VERSION - 1)).yaml"
15+
cp "./pkg/config/static/metadata-1_$((K0S_MINOR_VERSION - 1)).yaml" "./pkg/config/static/metadata-1_${K0S_MINOR_VERSION}.yaml"
16+
fi
17+
18+
make buildtools
19+
if [ "$UPDATE_ALL_IMAGES" = "true" ]; then
20+
./output/bin/buildtools update images k0s
21+
else
22+
./output/bin/buildtools update images \
23+
--image kube-proxy --image pause \
24+
--image calico-cni --image calico-node --image calico-kube-controllers \
25+
k0s
26+
fi
27+
}
28+
29+
function main() {
30+
local minor_version=$1
31+
local minor_version_minus_1=$((minor_version - 1))
32+
local minor_version_minus_2=$((minor_version - 2))
33+
34+
# substitute images for the major.minor version minus 2
35+
export K0S_MINOR_VERSION="$minor_version_minus_2"
36+
update_go_dependencies
37+
update_k0s_metadata
38+
39+
# reset go.mod and go.sum
40+
git checkout -- **/go.mod **/go.sum
41+
42+
# substitute images for the major.minor version minus 1
43+
export K0S_MINOR_VERSION="$minor_version_minus_1"
44+
update_go_dependencies
45+
update_k0s_metadata
46+
47+
# reset go.mod and go.sum
48+
git checkout -- **/go.mod **/go.sum
49+
50+
# substitute images for the current major.minor version
51+
export K0S_MINOR_VERSION="$minor_version"
52+
update_go_dependencies
53+
update_k0s_metadata
54+
55+
echo "Done"
56+
}
57+
58+
main "$@"

versions.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
K0S_MINOR_VERSION ?= 33
77

88
# K0S Versions
9-
K0S_VERSION_1_33 = v1.33.3+k0s.0
10-
K0S_VERSION_1_32 = v1.32.7+k0s.0
11-
K0S_VERSION_1_31 = v1.31.11+k0s.0
9+
K0S_VERSION_1_33 = v1.33.4+k0s.0
10+
K0S_VERSION_1_32 = v1.32.8+k0s.0
11+
K0S_VERSION_1_31 = v1.31.12+k0s.0
1212
K0S_VERSION_1_30 = v1.30.14+k0s.0
1313
K0S_VERSION_1_29 = v1.29.15+k0s.0
1414

0 commit comments

Comments
 (0)