fix: honor OCI foundation state file during reconciliation

This commit is contained in:
juvenal.diaz 2026-10-27 15:42:02 -06:00
parent 593a06b170
commit be89319a1f
1 changed files with 2 additions and 2 deletions

View File

@ -3639,9 +3639,9 @@ oci_foundation_save_config() {
oci_foundation_reconcile_existing() {
local oci_bin="" output_file status compartment_id compartment_name
local homelab_state_file="${REPO_ROOT}/bootstrap/oci/terraform.tfstate"
local homelab_state_file="${LAB_OCI_FOUNDATION_STATE_FILE:-${REPO_ROOT}/bootstrap/oci/terraform.tfstate}"
local homelab_compartment_managed=false
if [[ -f "${homelab_state_file}" ]] && grep -q 'oci_identity_compartment.homelab' "${homelab_state_file}"; then
if [[ -f "${homelab_state_file}" ]] && grep -q '"type"[[:space:]]*:[[:space:]]*"oci_identity_compartment"' "${homelab_state_file}"; then
homelab_compartment_managed=true
fi
if command -v oci >/dev/null 2>&1; then