34 lines
740 B
Bash
Executable File
34 lines
740 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
missing=0
|
|
|
|
check_required() {
|
|
local cmd="$1"
|
|
if command -v "$cmd" >/dev/null 2>&1; then
|
|
echo "ok: $cmd"
|
|
else
|
|
echo "ERROR: missing required tool: $cmd" >&2
|
|
missing=1
|
|
fi
|
|
}
|
|
|
|
check_required kubectl
|
|
check_required helm
|
|
check_required sops
|
|
check_required python3
|
|
check_required curl
|
|
|
|
if command -v kubectl >/dev/null 2>&1; then
|
|
if kubectl cnpg --help >/dev/null 2>&1; then
|
|
echo "ok: kubectl cnpg"
|
|
else
|
|
echo "WARN: kubectl cnpg plugin is missing; install with: kubectl krew install cnpg" >&2
|
|
if ! kubectl krew version >/dev/null 2>&1; then
|
|
echo "WARN: kubectl krew is missing; install krew before using kubectl krew install cnpg" >&2
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
exit "$missing"
|