diff --git a/deploy.sh b/deploy.sh index 5f62f26..5763713 100755 --- a/deploy.sh +++ b/deploy.sh @@ -25,6 +25,9 @@ def die(msg): print(f"ERROR: {msg}", file=sys.stderr) sys.exit(1) +def warn(msg): + print(f"WARN: {msg}", file=sys.stderr) + c = configparser.ConfigParser() c.read(sys.argv[1]) g = c["Global"] if "Global" in c else {} @@ -44,16 +47,19 @@ try: provisioner = sc.get("provisioner", "") params = sc.get("parameters", {}) disk_type = params.get("type", "") - - if provisioner != "pd.csi.storage.gke.io": - die(f"storage-class configuration error: StorageClass '{sc_name}' must use provisioner 'pd.csi.storage.gke.io', but uses '{provisioner}'.") - - 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}).", file=sys.stderr) + + if provisioner == "pd.csi.storage.gke.io" and disk_type == "pd-standard": + print(f"Verified live Supabase StorageClass '{sc_name}' (type: {disk_type}).", file=sys.stderr) + else: + warn( + f"storage-class preflight advisory: StorageClass '{sc_name}' is present but not the expected GKE pd-standard class " + f"(provisioner='{provisioner}', type='{disk_type}'). Supabase deploy will reconcile it." + ) except subprocess.CalledProcessError: - die(f"storage-class configuration error: Required StorageClass '{sc_name}' does not exist on cluster '{ctx}'.") + warn( + f"storage-class preflight advisory: StorageClass '{sc_name}' does not exist on cluster '{ctx}'. " + "Supabase deploy will create/reconcile it in this run." + ) PY fi diff --git a/tests/test_repair_update_and_supabase_flags.py b/tests/test_repair_update_and_supabase_flags.py index eae1c6a..7db5ba9 100644 --- a/tests/test_repair_update_and_supabase_flags.py +++ b/tests/test_repair_update_and_supabase_flags.py @@ -616,6 +616,15 @@ def test_supabase_deploy_runtime_constraint_cleanup_clears_topology_spread_const assert '"topologySpreadConstraints":null' in script +def test_deploy_entrypoint_supabase_storageclass_preflight_is_advisory_not_blocking(): + """Top-level deploy preflight must not hard-exit before Supabase can reconcile/create its GKE StorageClass.""" + script = (REPO_ROOT / "deploy.sh").read_text(encoding="utf-8") + + assert "storage-class preflight advisory" in script + assert "Supabase deploy will create/reconcile it in this run" in script + assert "Required StorageClass" not in script + + def test_init_gitlab_adds_noop_rerun_fast_path_guards(): """GitLab init must include fast-path guards to skip heavy rerun work when operator/CR are unchanged.""" script = (REPO_ROOT / "etc" / "init_gitlab.sh").read_text(encoding="utf-8")