Fail closed when OCI discovery is unavailable
This commit is contained in:
parent
96783257a8
commit
98ff5d55f2
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue