Skip to content

Commit 13145e2

Browse files
aknyshosterman
andauthored
Apply suggestions from code review
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
1 parent 7b18f17 commit 13145e2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

internal/exec/terraform.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error {
349349

350350
// Print command info
351351
log.Debug("Command info:")
352-
log.Debug("Terraform binary: " + info.Command)
352+
log.Debug("Terraform executable", "command", info.Command)
353353

354354
if info.SubCommand2 == "" {
355-
log.Debug(fmt.Sprintf("Terraform command: %s", info.SubCommand))
355+
log.Debug("Executing terraform", "command", info.SubCommand)
356356
} else {
357357
log.Debug(fmt.Sprintf("Terraform command: %s %s", info.SubCommand, info.SubCommand2))
358358
}
@@ -375,7 +375,7 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error {
375375
log.Debug("Stack path: " + filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath, info.Stack))
376376
}
377377

378-
log.Debug(fmt.Sprintf("Working dir: %s", workingDir))
378+
log.Debug("Working directory", "path", workingDir)
379379

380380
allArgsAndFlags := strings.Fields(info.SubCommand)
381381

internal/exec/terraform_outputs.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func execTerraformOutput(
119119
if atmosConfig.Components.Terraform.AutoGenerateBackendFile {
120120
backendFileName := filepath.Join(componentPath, "backend.tf.json")
121121

122-
log.Debug("Writing the backend config to file:", "file", backendFileName)
122+
log.Debug("Writing backend config", "file", backendFileName)
123123

124124
backendTypeSection, ok := sections["backend_type"].(string)
125125
if !ok {
@@ -141,7 +141,7 @@ func execTerraformOutput(
141141
return nil, err
142142
}
143143

144-
log.Debug("Wrote the backend config to file:", "file", backendFileName)
144+
log.Debug("Wrote backend config", "file", backendFileName)
145145
}
146146

147147
// Generate `providers_override.tf.json` file if the `providers` section is configured
@@ -150,15 +150,15 @@ func execTerraformOutput(
150150
if ok && len(providersSection) > 0 {
151151
providerOverrideFileName := filepath.Join(componentPath, "providers_override.tf.json")
152152

153-
log.Debug("Writing the provider overrides to file:", "file", providerOverrideFileName)
153+
log.Debug("Writing provider overrides", "file", providerOverrideFileName)
154154

155155
providerOverrides := generateComponentProviderOverrides(providersSection)
156156
err = u.WriteToFileAsJSON(providerOverrideFileName, providerOverrides, 0o644)
157157
if err != nil {
158158
return nil, err
159159
}
160160

161-
log.Debug("Wrote the provider overrides to file:", "file", providerOverrideFileName)
161+
log.Debug("Wrote provider overrides", "file", providerOverrideFileName)
162162
}
163163

164164
// Initialize Terraform/OpenTofu
@@ -195,7 +195,7 @@ func execTerraformOutput(
195195
// Before executing `terraform init`, delete the `.terraform/environment` file from the component directory
196196
cleanTerraformWorkspace(*atmosConfig, componentPath)
197197

198-
log.Debug(fmt.Sprintf("Executing 'terraform init %s -s %s'", component, stack))
198+
log.Debug("Executing terraform", "command", fmt.Sprintf("terraform init %s -s %s", component, stack))
199199

200200
var initOptions []tfexec.InitOption
201201
initOptions = append(initOptions, tfexec.Upgrade(false))

0 commit comments

Comments
 (0)