chore: improve error logging and extend StorageClass validation

- Redirected error messages in `deploy.sh` and `render_supabase.py` to `stderr` for better logging clarity.
- Extended allowed prefixes for Supabase StorageClass to include `pd-standard`.
This commit is contained in:
chrisfu 2026-04-16 00:05:11 -07:00
parent 0f68c4ddfe
commit 5ebe4d6c06
3 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ import json
import configparser
def die(msg):
print(f"ERROR: {msg}")
print(f"ERROR: {msg}", file=sys.stderr)
sys.exit(1)
c = configparser.ConfigParser()
@ -51,7 +51,7 @@ try:
if disk_type != "pd-standard":
die(f"storage-class configuration error: StorageClass '{sc_name}' must use parameters.type 'pd-standard', but uses '{disk_type}'.")
print(f"Verified live Supabase StorageClass '{sc_name}' (type: {disk_type}).")
print(f"Verified live Supabase StorageClass '{sc_name}' (type: {disk_type}).", file=sys.stderr)
except subprocess.CalledProcessError:
die(f"storage-class configuration error: Required StorageClass '{sc_name}' does not exist on cluster '{ctx}'.")
PY

View File

@ -131,7 +131,7 @@ warn() {
}
log() {
echo "==> $*"
echo "==> $*" >&2
}
write_split_supabase_values() {

View File

@ -931,7 +931,7 @@ def _build_overlay(cfg: configparser.ConfigParser, args: argparse.Namespace) ->
if supabase_storage_class:
# Validate: must be a synology/merlin/gke mount — refuse pi/local SD card classes
allowed_prefixes = ("synology", "merlin-local-iscsi", "myrddin-local-iscsi", "supabase-gke", "supabase-standard")
allowed_prefixes = ("synology", "merlin-local-iscsi", "myrddin-local-iscsi", "supabase-gke", "supabase-standard", "pd-standard")
if not any(supabase_storage_class.startswith(p) for p in allowed_prefixes):
raise SystemExit(
f"SUPABASE_STORAGE_CLASS '{supabase_storage_class}' is not a synology or GKE CSI mount. "