fix: separate OCI cleanup resource identifiers
This commit is contained in:
parent
fab0596b74
commit
cc348dfc04
|
|
@ -25,14 +25,14 @@ region="${LAB_OCI_REGION:-${OCI_CLI_REGION:-}}"
|
||||||
|
|
||||||
oci_json_ids() {
|
oci_json_ids() {
|
||||||
local command_json="$(cat)"
|
local command_json="$(cat)"
|
||||||
python3 -c 'import json,sys; raw=sys.stdin.read().strip(); data=json.loads(raw) if raw else {}; print("\\n".join(x["id"] for x in data.get("data", [])))' <<<"${command_json}"
|
python3 -c 'import json,sys; raw=sys.stdin.read().strip(); data=json.loads(raw) if raw else {}; print("\n".join(x["id"] for x in data.get("data", [])))' <<<"${command_json}"
|
||||||
}
|
}
|
||||||
|
|
||||||
mapfile -t compartments < <(
|
mapfile -t compartments < <(
|
||||||
printf '%s\n' "${tenancy}"
|
printf '%s\n' "${tenancy}"
|
||||||
"${oci_bin}" iam compartment list --compartment-id "${tenancy}" \
|
"${oci_bin}" iam compartment list --compartment-id "${tenancy}" \
|
||||||
--compartment-id-in-subtree true --all --output json 2>/dev/null \
|
--compartment-id-in-subtree true --all --output json 2>/dev/null \
|
||||||
| python3 -c 'import json,sys; raw=sys.stdin.read().strip(); data=json.loads(raw) if raw else {}; print("\\n".join(x["id"] for x in data.get("data", [])))'
|
| python3 -c 'import json,sys; raw=sys.stdin.read().strip(); data=json.loads(raw) if raw else {}; print("\n".join(x["id"] for x in data.get("data", [])))'
|
||||||
)
|
)
|
||||||
|
|
||||||
declare -a instances=() boot_volumes=() block_volumes=() public_ips=() vcns=()
|
declare -a instances=() boot_volumes=() block_volumes=() public_ips=() vcns=()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue