Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aknysh committed Dec 6, 2024
1 parent 19ac4ae commit 09da6dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ components:
metadata:
# Point to the Terraform component
component: "test/template-functions-test2"
terraform_workspace: '{{ .vars.tenant }}-{{ .vars.environment }}-{{ .vars.stage }}'
terraform_workspace: '{{ .vars.tenant }}-{{ .vars.environment }}-{{ .vars.stage }}-test'
settings:
spacelift:
workspace_enabled: false
Expand Down
2 changes: 2 additions & 0 deletions internal/exec/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error {
}
return nil
}

varFile := constructTerraformComponentVarfileName(info)
planFile := constructTerraformComponentPlanfileName(info)

// Print component variables and write to file
// Don't process variables when executing `terraform workspace` commands
if info.SubCommand != "workspace" {
Expand Down
4 changes: 4 additions & 0 deletions internal/exec/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ func ProcessStacks(
if i, ok := configAndStacksInfo.ComponentSection[cfg.CommandSectionName].(string); ok {
configAndStacksInfo.Command = i
}

if i, ok := configAndStacksInfo.ComponentSection[cfg.WorkspaceSectionName].(string); ok {
configAndStacksInfo.TerraformWorkspace = i
}
}

// Spacelift stack
Expand Down

0 comments on commit 09da6dc

Please sign in to comment.