diff --git a/lib/jeannie/pipeline.sh b/lib/jeannie/pipeline.sh index 637a3a8..7958942 100644 --- a/lib/jeannie/pipeline.sh +++ b/lib/jeannie/pipeline.sh @@ -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.