This repository has been archived on 2026-10-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
metallb-kubernetes/test.sh
T
feedc0de fa128b0d53
Validate and deploy MetalLB configuration / Validate manifests (push) Successful in 17s
Validate and deploy MetalLB configuration / Deploy site configuration (push) Successful in 18s
Introduce CI for this Repo too
2026-09-04 16:04:52 +02:00

35 lines
1.1 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@sha256:85dbef6b4b312b99133decc9c6fc9495e9fc5f92293d4ff3b7e1b30f5611823c
sh -n "${project_dir}/install.sh"
bash -n "${project_dir}/create-ci-kubeconfig.sh"
bash -n "${project_dir}/test.sh"
grep -Fq 'METALLB_VERSION=v0.16.0' "${project_dir}/install.sh"
grep -Fq 'METALLB_MANIFEST_SHA256=b0b9be2802f10aa32d45308b4457d06cde0c70544712c8d0cf5511657ffd2b69' \
"${project_dir}/install.sh"
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 "${project_dir}/metallb.yaml" -ignore-missing-schemas
validate_file "${project_dir}/ci-deployer.yaml"
echo "MetalLB scripts and site-specific resources are valid."