Skip to content

Commit

Permalink
Handle nil variables properly
Browse files Browse the repository at this point in the history
Should write some tests against this but for now should fix
  • Loading branch information
michaeljguarino committed Aug 22, 2024
1 parent 60cb34f commit 19a25b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/harness/tool/terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ func (in *Terraform) init() v1.Tool {
in.planFileName = "terraform.tfplan"
helpers.EnsureFileOrDie(path.Join(in.dir, in.planFileName), nil)

in.variablesFileName = "plural.auto.tfvars.json"
helpers.EnsureFileOrDie(path.Join(in.dir, in.variablesFileName), in.variables)
if in.variables != nil && *in.variables == "" {
in.variablesFileName = "plural.auto.tfvars.json"
helpers.EnsureFileOrDie(path.Join(in.dir, in.variablesFileName), in.variables)
}

return in
}
Expand Down

0 comments on commit 19a25b8

Please sign in to comment.