Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/pyxis/templates/driver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
19 changes: 19 additions & 0 deletions scripts/check-rendering.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
Loading