From 6832ddd061c664ae51b6d8e43e5a7caf7b1513e7 Mon Sep 17 00:00:00 2001 From: haitham911 Date: Thu, 19 Dec 2024 04:50:48 +0200 Subject: [PATCH] fix clean cmd --- internal/exec/terraform.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/exec/terraform.go b/internal/exec/terraform.go index fcf65bdb3..0690964f7 100644 --- a/internal/exec/terraform.go +++ b/internal/exec/terraform.go @@ -75,13 +75,10 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error { shouldCheckStack := true // Skip stack processing when cleaning with --everything or --force flags to allow // cleaning without requiring stack configuration - if info.SubCommand == "clean" && - (u.SliceContainsString(info.AdditionalArgsAndFlags, everythingFlag) || - u.SliceContainsString(info.AdditionalArgsAndFlags, forceFlag)) { + if info.SubCommand == "clean" { if info.ComponentFromArg == "" { shouldProcessStacks = false } - shouldCheckStack = info.Stack != "" } @@ -96,7 +93,7 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error { } } - if !info.ComponentIsEnabled { + if !info.ComponentIsEnabled && info.SubCommand != "clean" { u.LogInfo(atmosConfig, fmt.Sprintf("component '%s' is not enabled and skipped", info.ComponentFromArg)) return nil }