Ignore stale OCI tenancy environment values
This commit is contained in:
parent
afb339e1ee
commit
85d232c263
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue