Use supported compartment discovery options
This commit is contained in:
parent
7f14cc5609
commit
4f31184ae4
|
|
@ -3857,7 +3857,6 @@ oci_foundation_reconcile_existing() {
|
|||
[[ -n "${compartment_id}" && "${compartment_id}" != "null" ]] || {
|
||||
compartment_id="$("${oci_bin}" iam compartment list \
|
||||
--compartment-id "${LAB_OCI_TENANCY_ID}" \
|
||||
--compartment-id-in-subtree true \
|
||||
--name "${compartment_name}" --all \
|
||||
--query 'data[0].id' --raw-output 2>/dev/null || true)"
|
||||
if [[ -n "${compartment_id}" && "${compartment_id}" != "null" ]]; then
|
||||
|
|
@ -4352,7 +4351,7 @@ PY
|
|||
oci_discover_vcn_id() {
|
||||
local root_compartment="$1" display_name="$2" target_cidr="${3:-}" oci_bin compartments compartment_id payload result
|
||||
oci_bin="$(oci_cli_resolve)" || return 1
|
||||
compartments="${root_compartment}"$'\n'$("${oci_bin}" iam compartment list --compartment-id "${root_compartment}" --compartment-id-in-subtree true --all --query 'data[].id' --raw-output 2>/dev/null || true)
|
||||
compartments="${root_compartment}"$'\n'$("${oci_bin}" iam compartment list --compartment-id "${root_compartment}" --all --query 'data[].id' --raw-output 2>/dev/null || true)
|
||||
while IFS= read -r compartment_id; do
|
||||
[[ -n "${compartment_id}" ]] || continue
|
||||
payload="$("${oci_bin}" network vcn list --compartment-id "${compartment_id}" --all --output json 2>/dev/null || true)"
|
||||
|
|
|
|||
Loading…
Reference in New Issue