Fail closed when OCI discovery is unavailable
Homelab Main / validate (push) Waiting to run Details
Homelab Main / running-update (push) Blocked by required conditions Details
Homelab Main / debian-ops (push) Blocked by required conditions Details

This commit is contained in:
juvenal.diaz 2026-10-29 12:50:19 -06:00
parent 96783257a8
commit 98ff5d55f2
1 changed files with 6 additions and 2 deletions

View File

@ -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