Skip to content

Commit f2a6117

Browse files
committed
feat(capi): update the Talos bootstrap provider to v0.6.13
v0.6.13 is the latest stable release; the only change from v0.6.12 is support for Talos v1.14 machine configuration. The v0.6 series stays on the v1beta1 contract, which Cluster API v1.13 still accepts. The v0.7 series that moves to v1beta2 has only pre-releases so far. The update target now checks the downloaded release assets against pinned sums before applying patches/, and refreshes metadata-talos.yaml along with the components. The bats suite holds the Talos provider to the same checks as core and kubeadm: its ConfigMap and BootstrapProvider carry the vendored version, its blob matches its YAML, and the YAML with patches/ reverted matches the pinned release sum. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent ce58045 commit f2a6117

6 files changed

Lines changed: 34 additions & 17 deletions

File tree

‎hack/capi-provider-components_test.bats‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ load test_helper
1818
REPO_ROOT="$(cd "$(dirname "${BATS_TEST_FILENAME:-$0}")/.." && pwd)"
1919

2020
check_pair() {
21-
local pkg="$1" yaml="$2"
21+
local pkg="$1" yaml="$2" blob="${3:-components.gz}"
2222
local dir="$REPO_ROOT/packages/system/$pkg/files"
2323

2424
[ -f "$dir/$yaml" ] || { echo "missing $pkg/files/$yaml" >&2; return 1; }
25-
[ -f "$dir/components.gz" ] || { echo "missing $pkg/files/components.gz" >&2; return 1; }
25+
[ -f "$dir/$blob" ] || { echo "missing $pkg/files/$blob" >&2; return 1; }
2626

2727
local work; work="$(mktemp -d)"
28-
gzip -dc "$dir/components.gz" > "$work/decompressed.yaml"
28+
gzip -dc "$dir/$blob" > "$work/decompressed.yaml"
2929

3030
if ! cmp -s "$work/decompressed.yaml" "$dir/$yaml"; then
31-
echo "$pkg: components.gz does not match $yaml" >&2
31+
echo "$pkg: $blob does not match $yaml" >&2
3232
echo "the chart mounts the blob, so the cluster would run what the YAML does not say" >&2
33-
if grep -q '^components:' "$REPO_ROOT/packages/system/$pkg/Makefile" 2>/dev/null; then
33+
if [ "$blob" = components.gz ] && grep -q '^components:' "$REPO_ROOT/packages/system/$pkg/Makefile" 2>/dev/null; then
3434
echo "run: make -C packages/system/$pkg components" >&2
3535
else
36-
echo "regenerate: gzip -9 -n -c files/$yaml > files/components.gz" >&2
36+
echo "regenerate: gzip -9 -n -c files/$yaml > files/$blob" >&2
3737
fi
3838
head -40 "$work/decompressed.yaml" > "$work/a"
3939
head -40 "$dir/$yaml" > "$work/b"
@@ -206,6 +206,18 @@ check_bootstrap_version() {
206206
check_bootstrap_version CAPI_VERSION bootstrap
207207
}
208208

209+
@test "Talos bootstrap ships the version its Makefile vendored" {
210+
check_bootstrap_version CABPT_UPSTREAM_VERSION bootstrap-talos
211+
}
212+
213+
@test "Talos bootstrap components-talos.gz matches the vendored bootstrap-components-talos.yaml" {
214+
check_pair capi-providers-bootstrap bootstrap-components-talos.yaml components-talos.gz
215+
}
216+
217+
@test "Talos bootstrap vendored files match the sums its Makefile pins" {
218+
check_patched_sums capi-providers-bootstrap CABPT bootstrap-components-talos.yaml metadata-talos.yaml
219+
}
220+
209221
@test "kubeadm bootstrap components.gz matches the vendored bootstrap-components.yaml" {
210222
check_pair capi-providers-bootstrap bootstrap-components.yaml
211223
}

‎packages/system/capi-providers-bootstrap/Makefile‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ include ../../../hack/package.mk
1717
# in lockstep with templates/providers.yaml (BootstrapProvider spec.version)
1818
# and templates/configmaps.yaml (ConfigMap name) — clusterctl matches the
1919
# bundle by tag.
20-
CABPT_UPSTREAM_VERSION = v0.6.12
20+
CABPT_UPSTREAM_VERSION = v0.6.13
21+
CABPT_URL=https://github.com/siderolabs/cluster-api-bootstrap-provider-talos/releases/download/$(CABPT_UPSTREAM_VERSION)
22+
# SHA-256 of the two CABPT release assets at CABPT_UPSTREAM_VERSION, as
23+
# downloaded, before patches/ is applied.
24+
CABPT_SHA256_COMPONENTS=1e721ad294bdd5c8994aa957017cb94ad6e0cfd4ba52a52b45ed456d93efd4f8
25+
CABPT_SHA256_METADATA=f2069963ae63593a795a7d134bb35999e372fd36240219a539f123c9387507ed
2126

2227
# Refreshes files/bootstrap-components-talos.yaml + files/components-talos.gz
2328
# from upstream CABPT release artifacts at CABPT_UPSTREAM_VERSION with
@@ -26,22 +31,22 @@ CABPT_UPSTREAM_VERSION = v0.6.12
2631
# see PR #2610 for the full rationale). Mirrors the symmetric update
2732
# target in packages/system/capi-providers-cpprovider/Makefile.
2833
#
29-
# Run when bumping CABPT_UPSTREAM_VERSION or editing patches/. The
30-
# metadata-talos.yaml file is checked in as-is from upstream and is not
31-
# refreshed here (it changes far less often and a manual curl+diff is
32-
# enough when CABPT cuts a new release series).
34+
# Run when bumping CABPT_UPSTREAM_VERSION and the two sums, or when editing
35+
# patches/. It also refreshes files/metadata-talos.yaml.
3336
update:
3437
@command -v patch >/dev/null || { echo "patch(1) required"; exit 1; }
3538
rm -rf .update-tmp
3639
mkdir .update-tmp
37-
curl -sSL "https://github.com/siderolabs/cluster-api-bootstrap-provider-talos/releases/download/$(CABPT_UPSTREAM_VERSION)/bootstrap-components.yaml" \
38-
-o .update-tmp/bootstrap-components.yaml
40+
curl -fL -o .update-tmp/bootstrap-components.yaml $(CABPT_URL)/bootstrap-components.yaml
41+
curl -fL -o .update-tmp/metadata.yaml $(CABPT_URL)/metadata.yaml
42+
printf '%s .update-tmp/bootstrap-components.yaml\n%s .update-tmp/metadata.yaml\n' $(CABPT_SHA256_COMPONENTS) $(CABPT_SHA256_METADATA) | sha256sum -c -
3943
for p in patches/*.diff; do \
4044
[ -e "$$p" ] || continue; \
4145
(cd .update-tmp && patch bootstrap-components.yaml < ../$$p) || exit 1; \
4246
done
4347
mv .update-tmp/bootstrap-components.yaml files/bootstrap-components-talos.yaml
44-
gzip -nc files/bootstrap-components-talos.yaml > files/components-talos.gz
48+
mv .update-tmp/metadata.yaml files/metadata-talos.yaml
49+
gzip -9 -n -c files/bootstrap-components-talos.yaml > files/components-talos.gz
4550
rm -rf .update-tmp
4651

4752
# Refresh the vendored kubeadm bootstrap provider. Bump CAPI_VERSION and the two

‎packages/system/capi-providers-bootstrap/files/bootstrap-components-talos.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ spec:
699699
- --insecure-diagnostics=${CAPI_INSECURE_DIAGNOSTICS:=false}
700700
command:
701701
- /manager
702-
image: ghcr.io/siderolabs/cluster-api-talos-controller:v0.6.12
702+
image: ghcr.io/siderolabs/cluster-api-talos-controller:v0.6.13
703703
imagePullPolicy: Always
704704
livenessProbe:
705705
httpGet:
-91 Bytes
Binary file not shown.

‎packages/system/capi-providers-bootstrap/templates/configmaps.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ data:
1515
apiVersion: v1
1616
kind: ConfigMap
1717
metadata:
18-
name: v0.6.12-bootstrap-talos
18+
name: v0.6.13-bootstrap-talos
1919
labels:
2020
bootstrap-components: cozy
2121
bootstrap-provider: talos

‎packages/system/capi-providers-bootstrap/templates/providers.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ metadata:
2727
name: talos
2828
spec:
2929
# https://github.com/siderolabs/cluster-api-bootstrap-provider-talos
30-
version: v0.6.12-bootstrap-talos
30+
version: v0.6.13-bootstrap-talos
3131
fetchConfig:
3232
selector:
3333
matchLabels:

0 commit comments

Comments
 (0)