From ce2d09399a938cc4504e22d9d7169e7079eda101 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Mon, 26 Oct 2026 18:28:29 -0600 Subject: [PATCH] fix: skip OCI default route table deletion --- scripts/oci-cleanup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/oci-cleanup b/scripts/oci-cleanup index 2e6ed15..5321846 100755 --- a/scripts/oci-cleanup +++ b/scripts/oci-cleanup @@ -93,9 +93,9 @@ for item in "${subnets[@]}"; do IFS='|' read -r compartment id <<<"${item}"; del # route tables, and let VCN deletion remove the default objects. for item in "${route_tables[@]}"; do IFS='|' read -r compartment id <<<"${item}" - delete_resource "route rules ${id}" "${oci_bin}" network route-table update --rt-id "${id}" --route-rules '[]' - is_default="$("${oci_bin}" network route-table get --rt-id "${id}" --query 'data."is-default"' --raw-output 2>/dev/null || true)" - [[ "${is_default}" == true ]] || delete_resource "route table ${id}" "${oci_bin}" network route-table delete --rt-id "${id}" --force + delete_resource "route rules ${id}" "${oci_bin}" network route-table update --rt-id "${id}" --route-rules '[]' --force + display_name="$("${oci_bin}" network route-table get --rt-id "${id}" --query 'data."display-name"' --raw-output 2>/dev/null || true)" + [[ "${display_name}" == default\ route\ table* ]] || delete_resource "route table ${id}" "${oci_bin}" network route-table delete --rt-id "${id}" --force done echo "Skipping direct deletion of security lists and DHCP options; OCI removes them with their VCN." for item in "${nsgs[@]}"; do IFS='|' read -r compartment id <<<"${item}"; delete_resource "NSG ${id}" "${oci_bin}" network nsg delete --nsg-id "${id}" --force; done