Files
helm-charts-hardened/examples/stateless-server/run-tests.sh
T
Faisal Memon 9273f11f0a Support root-level spire-lib chart reuse (#785)
* Add root-level spire-lib chart

Signed-off-by: Faisal Memon <[email protected]>

* Make spire consume root-level spire-lib

Signed-off-by: Faisal Memon <[email protected]>

* Prepare chart dependencies in CI

Signed-off-by: Faisal Memon <[email protected]>

* Document DCO requirement in CODEX

Signed-off-by: Faisal Memon <[email protected]>

* Centralize local chart dependency prep

Signed-off-by: Faisal Memon <[email protected]>

* Exclude spire-lib from chart-testing install

Signed-off-by: Faisal Memon <[email protected]>

* Rename CODEX guide to AGENTS

Signed-off-by: Faisal Memon <[email protected]>

* Add make target for chart dependencies

Signed-off-by: Faisal Memon <[email protected]>

---------

Signed-off-by: Faisal Memon <[email protected]>
2026-04-09 05:14:05 -07:00

62 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
set -xe
SCRIPT="$(readlink -f "$0")"
SCRIPTPATH="$(dirname "${SCRIPT}")"
TESTDIR="${SCRIPTPATH}/../../.github/tests"
DEPS="${TESTDIR}/dependencies"
# shellcheck source=/dev/null
source "${SCRIPTPATH}/../../.github/scripts/parse-versions.sh"
# shellcheck source=/dev/null
source "${TESTDIR}/common.sh"
"${SCRIPTPATH}/../../.github/scripts/prepare-local-chart-deps.sh"
CLEANUP=1
for i in "$@"; do
case $i in
-c)
CLEANUP=0
shift # past argument=value
;;
esac
done
teardown() {
print_helm_releases
print_spire_workload_status spire-server
print_spire_workload_status spire-system
if [[ "$1" -ne 0 ]]; then
get_namespace_details spire-server
get_namespace_details spire-system
fi
if [ "${CLEANUP}" -eq 1 ]; then
helm uninstall --namespace "spire-server" spire 2>/dev/null || true
helm uninstall --namespace mysql mysql 2>/dev/null || true
kubectl delete ns spire-server 2>/dev/null || true
kubectl delete ns spire-system 2>/dev/null || true
fi
}
trap 'EC=$? && trap - SIGTERM && teardown $EC' SIGINT SIGTERM EXIT
kubectl create namespace spire-system --dry-run=client -o yaml | kubectl apply -f -
kubectl label namespace spire-system pod-security.kubernetes.io/enforce=privileged || true
kubectl create namespace spire-server --dry-run=client -o yaml | kubectl apply -f -
kubectl label namespace spire-server pod-security.kubernetes.io/enforce=restricted || true
helm upgrade --install mysql "${HELM_REGISTRY_MARIADB}" --version "$VERSION_MARIADB" \
--namespace spire-server \
--values "${DEPS}/mysql.yaml" \
--wait
helm upgrade --install --namespace "spire-server" \
--values "${COMMON_TEST_YOUR_VALUES},${SCRIPTPATH}/values.yaml,${SCRIPTPATH}/../misc/values-node-pod-antiaffinity.yaml" \
--set 'spire-server.dataStore.sql.password=sp1ff3Test' --wait spire charts/spire
helm test --namespace "spire-server" spire