Ignore stale OCI tenancy environment values
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-28 21:18:16 -06:00
parent afb339e1ee
commit 85d232c263
1 changed files with 15 additions and 0 deletions

View File

@ -8079,6 +8079,21 @@ refresh_oci_edge_endpoint() {
' "${oci_config_file}" 2>/dev/null || true)"
fi
fi
# Ignore stale shell values such as a literal command substitution or a
# compartment OCID accidentally assigned to the tenancy variable. This
# lets the validated OCI profile value above take precedence.
if [[ -n "${tenancy_id}" && "${tenancy_id}" != ocid1.tenancy.* ]]; then
tenancy_id=""
fi
if [[ -z "${tenancy_id}" && -r "${oci_config_file}" ]]; then
tenancy_id="$(awk '
/^[[:space:]]*tenancy[[:space:]]*=/ {
sub(/^[[:space:]]*tenancy[[:space:]]*=[[:space:]]*/, "", $0)
print $0
exit
}
' "${oci_config_file}" 2>/dev/null || true)"
fi
# Existing-instance mode can retain an old/null public_ip in state. Query
# OCI directly from the instance OCID and read the attached VNIC instead.