Skip to content

Commit ac4d179

Browse files
committed
f
1 parent 62188d6 commit ac4d179

File tree

3 files changed

+57
-4
lines changed

3 files changed

+57
-4
lines changed

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

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- cron: '0 4 * * *'
66
workflow_dispatch:
77
inputs:
8+
k0s-version:
9+
description: 'K0s version for discovering image versions'
10+
required: false
811
overwrite:
912
description: 'Overwrite the existing image tags'
1013
required: false
@@ -19,8 +22,8 @@ jobs:
1922
- name: Checkout
2023
uses: actions/checkout@v4
2124

22-
- name: Get tags
23-
id: get-tags
25+
- name: Get tags from wolfi repo
26+
id: get-tags-from-apkindex
2427
run: |
2528
set -euo pipefail
2629
@@ -37,11 +40,40 @@ jobs:
3740
echo "calico-node-tag=$calico_node_version"
3841
} >> "$GITHUB_OUTPUT"
3942
43+
- name: Get tags from k0s
44+
id: get-tags-from-k0s
45+
run: |
46+
set -euo pipefail
47+
48+
# We're only using the APKINDEX fi
49+
if [ -n "${{ github.event.inputs.k0s-version }}" ]; then
50+
make pkg/goods/bins/k0s K0S_VERSION="${{ github.event.inputs.k0s-version }}" K0S_BINARY_SOURCE_OVERRIDE=
51+
else
52+
make pkg/goods/bins/k0s
53+
fi
54+
55+
coredns_version=$(pkg/goods/bins/k0s airgap list-images --all | grep coredns: | awk -F':' '{ print $2 }')
56+
57+
sed "s/__COREDNS_VERSION__/$coredns_version/g" deploy/images/coredns/apko.tmpl.yaml > deploy/images/coredns/apko.yaml
58+
59+
{
60+
echo "coredns-tag=$coredns_version"
61+
} >> "$GITHUB_OUTPUT"
62+
4063
- name: Build and push calico-node image
4164
uses: ./.github/actions/build-dep-image-with-apko
4265
with:
4366
apko-config: deploy/images/calico-node/apko.yaml
44-
image-name: ttl.sh/ec/calico-node:${{ steps.get-tags.outputs.calico-node-tag }}
67+
image-name: ttl.sh/ec/calico-node:${{ steps.get-tags-from-apkindex.outputs.calico-node-tag }}
68+
# registry-username: ${{ secrets.REGISTRY_USERNAME_STAGING }}
69+
# registry-password: ${{ secrets.REGISTRY_PASSWORD_STAGING }}
70+
overwrite: true # ${{ github.event.inputs.overwrite }}
71+
72+
- name: Build and push coredns image
73+
uses: ./.github/actions/build-dep-image-with-apko
74+
with:
75+
apko-config: deploy/images/coredns/apko.yaml
76+
image-name: ttl.sh/ec/coredns:${{ steps.get-tags-from-k0s.outputs.coredns-tag }}
4577
# registry-username: ${{ secrets.REGISTRY_USERNAME_STAGING }}
4678
# registry-password: ${{ secrets.REGISTRY_PASSWORD_STAGING }}
4779
overwrite: true # ${{ github.event.inputs.overwrite }}

deploy/images/calico-node/apko.tmpl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ accounts:
1616
uid: 65532
1717
gid: 65532
1818
# calico-node is responsible for many host level networking tasks and as such, needs root
19-
run-as: "0"
19+
run-as: 0
2020

2121
environment:
2222
# Tell sv where to find the services

deploy/images/coredns/apko.tmpl.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
contents:
2+
repositories:
3+
- https://packages.wolfi.dev/os
4+
keyring:
5+
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
6+
packages:
7+
- coredns=__COREDNS_VERSION__
8+
9+
accounts:
10+
groups:
11+
- groupname: nonroot
12+
gid: 65532
13+
users:
14+
- username: nonroot
15+
uid: 65532
16+
gid: 65532
17+
# calico-node is responsible for many host level networking tasks and as such, needs root
18+
run-as: 65532
19+
20+
entrypoint:
21+
command: /usr/bin/coredns -dns.port=53

0 commit comments

Comments
 (0)