Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix terraform clean bugs #870

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
7 changes: 2 additions & 5 deletions internal/exec/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != ""

}
Expand All @@ -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
}
Expand Down
Loading