Files
feedc0de 328d24e82d
Validate and deploy Cilium / Render and validate (push) Successful in 18s
Validate and deploy Cilium / Deploy to Kubernetes (push) Successful in 1m31s
Strip sha256 hash
2026-10-14 20:17:01 +02:00

38 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
project_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
kubeconform_image=ghcr.io/yannh/kubeconform:v0.7.0
workdir=$(mktemp --directory)
trap 'rm -rf "${workdir}"' EXIT
sh -n "${project_dir}/install.sh"
bash -n "${project_dir}/render.sh"
bash -n "${project_dir}/create-ci-kubeconfig.sh"
bash -n "${project_dir}/test.sh"
grep -Fq 'CILIUM_VERSION=v1.20.0' "${project_dir}/install.sh"
grep -Fq 'cilium_version=${CILIUM_VERSION:-1.20.0}' "${project_dir}/render.sh"
"${project_dir}/render.sh" "${workdir}/cilium.yaml"
validate_file() {
local manifest=$1
shift
if command -v kubeconform >/dev/null 2>&1; then
kubeconform -strict -summary "$@" "${manifest}"
elif command -v docker >/dev/null 2>&1; then
docker run --rm --interactive "${kubeconform_image}" \
-strict -summary "$@" < "${manifest}"
else
echo "Required command not found: install kubeconform or Docker" >&2
exit 1
fi
}
validate_file "${workdir}/cilium.yaml" -ignore-missing-schemas
validate_file "${project_dir}/hubble-pki.yaml" -ignore-missing-schemas
validate_file "${project_dir}/cilium-alerts.yaml" -ignore-missing-schemas
validate_file "${project_dir}/ci-deployer.yaml"
echo "Cilium chart, scripts, and Kubernetes resources are valid."