From d095d284d26227e5e9c4d71368ded76a7f9d0ca6 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Tue, 27 Oct 2026 16:27:22 -0600 Subject: [PATCH] fix: use network-specific OCI Bastion names --- lib/jeannie/commands.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/jeannie/commands.sh b/lib/jeannie/commands.sh index df71705..30ed744 100644 --- a/lib/jeannie/commands.sh +++ b/lib/jeannie/commands.sh @@ -3756,6 +3756,14 @@ oci_foundation_reconcile_existing() { if [[ -n "${discovered_bastion_id}" && "${discovered_bastion_id}" != "null" ]]; then export LAB_OCI_BASTION_ID="${discovered_bastion_id}" printf 'Reusing existing OCI Bastion (%s).\n' "${discovered_bastion_id}" + elif [[ "${LAB_OCI_BASTION_NAME:-homelab-bastion}" == "homelab-bastion" && -n "${LAB_OCI_COMPARTMENT_ID:-}" ]]; then + # OCI can reject a duplicate Bastion name even when the + # existing Bastion belongs to an older network. Make the new + # Bastion name deterministic for this VCN. + local bastion_suffix + bastion_suffix="${LAB_OCI_COMPARTMENT_ID: -8}" + export LAB_OCI_BASTION_NAME="homelab-bastion-${bastion_suffix}" + printf 'Using network-specific OCI Bastion name %s.\n' "${LAB_OCI_BASTION_NAME}" fi fi fi