From 85d232c2639807e8b9206dd06d6e9076ec509af1 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Wed, 28 Oct 2026 21:18:16 -0600 Subject: [PATCH] Ignore stale OCI tenancy environment values --- lib/jeannie/pipeline.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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.