From 8ff6dcacd3b5706fef7a7de2dae74982780629e2 Mon Sep 17 00:00:00 2001 From: Marian Koreniuk Date: Wed, 14 Oct 2026 10:50:18 +0200 Subject: [PATCH] fix(kubernetes, proxmox-csi): pin the Proxmox CSI driver images by digest The CSI controller in the management cluster was referenced by the bare tag ghcr.io/sergelogvinov/proxmox-csi-controller:v0.20.0, and the node plugin in the tenant by the vendored chart's default, its appVersion as a bare tag. That registry is the one whose proxmox-cloud-controller- manager:v0.15.0 was re-pushed to a build that panics, so a tag there is not a statement of what runs. Both now carry the v0.20.0 digest: the controller through images/proxmox-csi-controller.tag, like the cloud-controller-manager, and the node plugin through repository and tag in the proxmox-csi values, which also makes it visible to hack/lib/image-refs.sh and therefore to the release multi-arch gate. Both digests are indexes for linux/amd64 and linux/arm64. Pinning takes the version out of the vendored chart's hands: a chart bump would bring a new appVersion while both pins kept naming the old release, and the controller and the node plugin would drift apart from the templates and from each other without anything noticing. hack/proxmox-csi-driver-pin_test.bats fails unless the chart's appVersion and both pins name the same release. The sig-storage sidecars stay on tags, as they do for the KubeVirt CSI driver: registry.k8s.io publishes them through image promotion, which does not overwrite a tag. Assisted-by: LLM Signed-off-by: Marian Koreniuk (cherry picked from commit 780b068df025c4a8fd3adf604a262dc749e76863) Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com> --- hack/proxmox-csi-driver-pin_test.bats | 44 +++++++++++++++++++ .../images/proxmox-csi-controller.tag | 1 + .../templates/csi-proxmox/controller.yaml | 2 +- packages/system/proxmox-csi/values.yaml | 11 +++++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 hack/proxmox-csi-driver-pin_test.bats create mode 100644 packages/apps/kubernetes/images/proxmox-csi-controller.tag diff --git a/hack/proxmox-csi-driver-pin_test.bats b/hack/proxmox-csi-driver-pin_test.bats new file mode 100644 index 000000000..610780bb9 --- /dev/null +++ b/hack/proxmox-csi-driver-pin_test.bats @@ -0,0 +1,44 @@ +#!/usr/bin/env bats +# Upstream releases the Proxmox CSI controller and node plugin together, and +# its chart renders both from one appVersion. Here they run in two places and +# are pinned in two packages: the controller in the management cluster +# (packages/apps/kubernetes, an images/.tag file) and the node plugin in the +# tenant (packages/system/proxmox-csi, a values override on the vendored +# chart). Both are pinned by digest because tags in that registry have been +# re-pushed, and the pin is what takes the version out of the chart's hands: +# `make update` with a new CHART_VERSION brings new templates and a new +# appVersion while both pins keep naming the old build, and nothing else +# notices. +# +# This asserts the chart's appVersion and both pins name the same release. + +load test_helper + +REPO_ROOT="$(cd "$(dirname "${BATS_TEST_FILENAME:-$0}")/.." && pwd)" + +@test "the Proxmox CSI controller and node plugin pin the vendored chart's release" { + chart="$REPO_ROOT/packages/system/proxmox-csi/charts/proxmox-csi-plugin/Chart.yaml" + values="$REPO_ROOT/packages/system/proxmox-csi/values.yaml" + tagfile="$REPO_ROOT/packages/apps/kubernetes/images/proxmox-csi-controller.tag" + + app_version=$(yq -r '.appVersion' "$chart") + node_tag=$(yq -r '."proxmox-csi-plugin".node.plugin.image.tag' "$values") + controller_ref=$(tr -d '[:space:]' < "$tagfile") + + [ -n "$app_version" ] && [ "$app_version" != null ] || { + echo "no appVersion in $chart" >&2 + return 1 + } + + [ "${node_tag%%@*}" = "$app_version" ] || { + echo "node plugin tag '$node_tag' is not the chart appVersion $app_version" >&2 + echo "set proxmox-csi-plugin.node.plugin.image.tag in packages/system/proxmox-csi/values.yaml" >&2 + return 1 + } + + [ "${controller_ref%%@*}" = "ghcr.io/sergelogvinov/proxmox-csi-controller:$app_version" ] || { + echo "controller ref '$controller_ref' is not proxmox-csi-controller:$app_version" >&2 + echo "update packages/apps/kubernetes/images/proxmox-csi-controller.tag" >&2 + return 1 + } +} diff --git a/packages/apps/kubernetes/images/proxmox-csi-controller.tag b/packages/apps/kubernetes/images/proxmox-csi-controller.tag new file mode 100644 index 000000000..bdaa47f7f --- /dev/null +++ b/packages/apps/kubernetes/images/proxmox-csi-controller.tag @@ -0,0 +1 @@ +ghcr.io/sergelogvinov/proxmox-csi-controller:v0.20.0@sha256:95ef74cce03e89a1706d9b32888a84bf44e0db439c4fe2a4334ce123728d4c3b diff --git a/packages/apps/kubernetes/templates/csi-proxmox/controller.yaml b/packages/apps/kubernetes/templates/csi-proxmox/controller.yaml index 8e2daa598..7d10abb41 100644 --- a/packages/apps/kubernetes/templates/csi-proxmox/controller.yaml +++ b/packages/apps/kubernetes/templates/csi-proxmox/controller.yaml @@ -112,7 +112,7 @@ spec: readOnlyRootFilesystem: true containers: - name: csi-driver - image: ghcr.io/sergelogvinov/proxmox-csi-controller:v0.20.0 + image: "{{ $.Files.Get "images/proxmox-csi-controller.tag" | trim }}" args: - "-v=4" - "--csi-address=unix:///csi/csi.sock" diff --git a/packages/system/proxmox-csi/values.yaml b/packages/system/proxmox-csi/values.yaml index 7895322fa..907d80c7e 100644 --- a/packages/system/proxmox-csi/values.yaml +++ b/packages/system/proxmox-csi/values.yaml @@ -33,3 +33,14 @@ proxmox-csi-plugin: node: tolerations: - operator: Exists + plugin: + # The chart's default is its appVersion as a bare tag, and tags in this + # registry have been re-pushed. The digest is the pin; the version must + # stay the chart's appVersion and the one in the kubernetes chart's + # images/proxmox-csi-controller.tag, since node and controller are two + # halves of one driver release (hack/proxmox-csi-driver-pin_test.bats). + # The repository repeats the chart default so that hack/lib/image-refs.sh, + # which does not read under charts/, sees a complete reference here. + image: + repository: ghcr.io/sergelogvinov/proxmox-csi-node + tag: v0.20.0@sha256:e0151137a1c5fa4faea9b4622436b203f1dc246ea37a3a77d09d3855c70aabd1