-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify-install.sh
More file actions
executable file
·43 lines (35 loc) · 1.06 KB
/
verify-install.sh
File metadata and controls
executable file
·43 lines (35 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
#
# Verify that all expected deployments and custom resources are ready.
# Reads component definitions from an overlay config file.
#
# Environment variables:
# OVERLAY - overlay name (default: "core")
# TIMEOUT - kubectl wait timeout (default: "600s")
#
set -euo pipefail
OVERLAY="${OVERLAY:-core}"
TIMEOUT="${TIMEOUT:-600s}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CONFIG_FILE="${SCRIPT_DIR}/../config/overlays/${OVERLAY}.env"
if [ ! -f "${CONFIG_FILE}" ]; then
echo "ERROR: Overlay config not found: ${CONFIG_FILE}"
exit 1
fi
# shellcheck disable=SC1090
source "${CONFIG_FILE}"
echo "=== Verifying install (overlay: ${OVERLAY}) ==="
echo ""
for entry in ${OPERATORS}; do
ns="${entry%%:*}"
deploy="${entry#*:}"
echo "--- ${deploy} (${ns}) ---"
kubectl get deployment -n "${ns}" "${deploy}"
done
echo ""
for entry in ${CUSTOM_RESOURCES}; do
ns="${entry%%:*}"
resource="${entry#*:}"
echo "--- ${resource} (${ns}) ---"
kubectl wait "${resource}" --for=condition=Ready -n "${ns}" --timeout="${TIMEOUT}"
done