From 98ff5d55f2e1f09b85aa7aef1e3e0065b5c913c7 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Thu, 29 Oct 2026 12:50:19 -0600 Subject: [PATCH] Fail closed when OCI discovery is unavailable --- lib/jeannie/commands.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/jeannie/commands.sh b/lib/jeannie/commands.sh index eeb8e81..9767ea9 100644 --- a/lib/jeannie/commands.sh +++ b/lib/jeannie/commands.sh @@ -3824,7 +3824,8 @@ oci_foundation_reconcile_existing() { elif [[ -x "${HOME}/.local/share/homelab/venvs/oci-cli/bin/oci" ]]; then oci_bin="${HOME}/.local/share/homelab/venvs/oci-cli/bin/oci" else - return 0 + echo "OCI foundation discovery requires the OCI CLI; refusing to plan without it." >&2 + return 1 fi # Persisted OCIDs can refer to deleted resources after a tenancy reset. @@ -4145,7 +4146,10 @@ oci_foundation_manage() { if [[ "${LAB_OCI_CLI_AUTO_INSTALL:-true}" == "true" ]]; then "${REPO_ROOT}/scripts/oci-auth" install fi - oci_foundation_reconcile_existing + oci_foundation_reconcile_existing || { + echo "OCI foundation discovery failed; refusing to plan or apply." >&2 + return 1 + } unset TF_VAR_enabled TF_VAR_region TF_VAR_tenancy_id TF_VAR_admin_cidr unset TF_VAR_compute_enabled unset TF_VAR_edge_availability_domain TF_VAR_email_availability_domain