Files
aevolution/tools/ci/prepare-kustomize.sh
T
dingoandClaude Opus 5.5 8a1e5ef53d Check rendered kustomize output in the deploy policy (M9.8f review)
The policy check now renders every overlay with pinned, checksum-verified
kustomize v5.8.1 (ADR-0088) and validates effective namespaces, session/input/
listener environment and arguments, ports, Services, quotas, policies, Ingresses
and Secrets, so inline/JSON patches and namespace changes cannot bypass it.
Route enabling is gated on an ADR-0087 amendment with tested server windows, route
addresses must be RFC 1918 or explicitly approved, and the Local health-check node
port is documented with its enabling evidence. Self-test grows to 33 cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 18:02:57 -04:00

30 lines
1.3 KiB
Bash

#!/usr/bin/env bash
# M9.8f review: pinned kustomize for rendered deployment-policy checks (ADR-0088).
# tools/ci/prepare-kustomize.sh [install-dir] (default .cache/tools/kustomize-<version>)
# Explicit preparation only: downloads the official Linux amd64 release archive,
# verifies the pinned SHA-256 and installs the single binary. Idempotent.
set -euo pipefail
version=v5.8.1
sha256=029a7f0f4e1932c52a0476cf02a0fd855c0bb85694b82c338fc648dcb53a819d
root="$(cd "$(dirname "$0")/../.." && pwd)"
target="${1:-$root/.cache/tools/kustomize-$version}"
if [ -x "$target/kustomize" ] && "$target/kustomize" version | grep -qx "$version"; then
echo "kustomize $version: $target/kustomize"
exit 0
fi
case "$(uname -s)/$(uname -m)" in
Linux/x86_64) ;;
*) echo "prepare-kustomize: only Linux x86_64 is pinned (got $(uname -s)/$(uname -m))" >&2; exit 2 ;;
esac
work="$(mktemp -d)"
trap 'rm -rf "$work"' EXIT
archive="kustomize_${version}_linux_amd64.tar.gz"
curl -fsSL --retry 3 -o "$work/$archive" \
"https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F$version/$archive"
echo "$sha256 $work/$archive" | sha256sum -c --quiet -
tar -xzf "$work/$archive" -C "$work" kustomize
mkdir -p "$target"
install -m 0755 "$work/kustomize" "$target/kustomize"
"$target/kustomize" version | grep -qx "$version"
echo "kustomize $version: $target/kustomize"