Skip to content

Commit 4b1c780

Browse files
committed
updates
1 parent 13145e2 commit 4b1c780

File tree

3 files changed

+23
-28
lines changed

3 files changed

+23
-28
lines changed

go.mod

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/exec/terraform.go

+20-25
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error {
160160
varFilePath = constructTerraformComponentVarfilePath(atmosConfig, info)
161161
}
162162

163-
log.Debug("Writing the variables to file", "file", varFilePath)
163+
log.Debug("Writing the variables", "file", varFilePath)
164164

165165
if !info.DryRun {
166166
err = u.WriteToFileAsJSON(varFilePath, info.ComponentVarsSection, 0o644)
@@ -347,36 +347,31 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error {
347347
}
348348
}
349349

350-
// Print command info
351-
log.Debug("Command info:")
352-
log.Debug("Terraform executable", "command", info.Command)
353-
350+
// Print the command info/context.
351+
var command string
354352
if info.SubCommand2 == "" {
355-
log.Debug("Executing terraform", "command", info.SubCommand)
353+
command = info.SubCommand
356354
} else {
357-
log.Debug(fmt.Sprintf("Terraform command: %s %s", info.SubCommand, info.SubCommand2))
358-
}
359-
360-
log.Debug(fmt.Sprintf("Arguments and flags: %v", info.AdditionalArgsAndFlags))
361-
log.Debug("Component: " + info.ComponentFromArg)
362-
363-
if len(info.BaseComponentPath) > 0 {
364-
log.Debug("Terraform component: " + info.BaseComponentPath)
355+
command = fmt.Sprintf("%s %s", info.SubCommand, info.SubCommand2)
365356
}
366357

358+
var inheritance string
367359
if len(info.ComponentInheritanceChain) > 0 {
368-
log.Debug("Inheritance: " + info.ComponentFromArg + " -> " + strings.Join(info.ComponentInheritanceChain, " -> "))
369-
}
370-
371-
if info.Stack == info.StackFromArg {
372-
log.Debug("Stack: " + info.StackFromArg)
373-
} else {
374-
log.Debug("Stack: " + info.StackFromArg)
375-
log.Debug("Stack path: " + filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath, info.Stack))
376-
}
377-
378-
log.Debug("Working directory", "path", workingDir)
360+
inheritance = info.ComponentFromArg + " -> " + strings.Join(info.ComponentInheritanceChain, " -> ")
361+
}
362+
363+
log.Debug("Terraform context",
364+
"executable", info.Command,
365+
"command", command,
366+
"component", info.ComponentFromArg,
367+
"stack", info.StackFromArg,
368+
"arguments and flags", info.AdditionalArgsAndFlags,
369+
"terraform component", info.BaseComponentPath,
370+
"inheritance", inheritance,
371+
"working directory", workingDir,
372+
)
379373

374+
// Prepare the terraform command
380375
allArgsAndFlags := strings.Fields(info.SubCommand)
381376

382377
switch info.SubCommand {

0 commit comments

Comments
 (0)