From b6cba2976a8eebaf1f6beb10cad61d7c5fa0bdb9 Mon Sep 17 00:00:00 2001 From: fyui001 Date: Sat, 7 Nov 2026 16:52:50 +0900 Subject: [PATCH] =?UTF-8?q?driver=20=E3=81=AE=20ConfigMap=20=E3=81=AE=20ch?= =?UTF-8?q?ecksum=20=E3=82=92=20driver.json=20=E3=81=AE=E4=B8=AD=E8=BA=AB?= =?UTF-8?q?=E3=81=A0=E3=81=91=E3=81=8B=E3=82=89=E5=8F=96=E3=82=8A=E3=80=81?= =?UTF-8?q?=E3=83=81=E3=83=A3=E3=83=BC=E3=83=88=E3=81=AE=E7=89=88=E3=82=92?= =?UTF-8?q?=E4=B8=8A=E3=81=92=E3=81=9F=E3=81=A0=E3=81=91=E3=81=A7=E3=81=AF?= =?UTF-8?q?=20driver=20=E3=82=92=E4=BD=9C=E3=82=8A=E7=9B=B4=E3=81=95?= =?UTF-8?q?=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 --- charts/pyxis/templates/driver-deployment.yaml | 2 +- scripts/check-rendering.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/charts/pyxis/templates/driver-deployment.yaml b/charts/pyxis/templates/driver-deployment.yaml index a1620cd..e28f20a 100644 --- a/charts/pyxis/templates/driver-deployment.yaml +++ b/charts/pyxis/templates/driver-deployment.yaml @@ -19,7 +19,7 @@ spec: labels: {{- include "pyxis.selectorLabels" (dict "root" . "part" "driver") | nindent 8 }} annotations: - checksum/config: {{ include (print $.Template.BasePath "/driver-configmap.yaml") . | sha256sum }} + checksum/config: {{ merge (dict "socketGroupId" (int .Values.carina.gid)) .Values.driver.config | toJson | sha256sum }} spec: {{- with include "pyxis.imagePullSecrets" . }}{{ . | trim | nindent 6 }}{{- end }} {{- with include "pyxis.nodeSelector" (dict "root" . "own" $driver.nodeSelector) }}{{ . | trim | nindent 6 }}{{- end }} diff --git a/scripts/check-rendering.sh b/scripts/check-rendering.sh index 7dffb40..2831855 100755 --- a/scripts/check-rendering.sh +++ b/scripts/check-rendering.sh @@ -29,6 +29,25 @@ if [ "$checksum_owners" != 'carina-driver' ]; then status=1 fi +# チャートの版だけが変わっても driver の checksum は変わらない (変わると版を上げるたびに driver が作り直され、録画が切れる) +checksum_of() { + printf '%s\n' "$1" | sed -n 's/^ *checksum\/config: *//p' | head -n 1 +} +bumped=$(mktemp -d) +cp -r charts/pyxis "$bumped/pyxis" +sed -i 's/^version: .*/version: 99.99.99/; s/^appVersion: .*/appVersion: 99.99.99/' "$bumped/pyxis/Chart.yaml" +rebumped=$(helm template carina "$bumped/pyxis" -f charts/pyxis/ci/default-values.yaml) +rm -rf "$bumped" +if [ "$(checksum_of "$rendered")" != "$(checksum_of "$rebumped")" ]; then + echo 'チャートの版を変えただけで driver の checksum が変わる' >&2 + status=1 +fi +reconfigured=$(helm template carina charts/pyxis -f charts/pyxis/ci/default-values.yaml --set driver.config.shutdownGraceHours=7) +if [ "$(checksum_of "$rendered")" = "$(checksum_of "$reconfigured")" ]; then + echo 'driver.json を変えても driver の checksum が変わらない' >&2 + status=1 +fi + services=$(printf '%s\n' "$rendered" | awk ' /^---/ { kind = ""; name = "" } /^kind: / { kind = $2 }