Skip to content

Commit

Permalink
Handle nil variables properly (#253)
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 authored Aug 22, 2024
1 parent f86d8cb commit bef7fd1
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 bef7fd1

Please sign in to comment.