Skip to content

Commit

Permalink
Fixed terraform version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
denis256 committed Oct 6, 2023
1 parent b2566ab commit a7af9cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/terraform/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ const (
TerraformDefaultPath = "terraform"
)

var defaultExecutable = defaultTerraformExecutable()
var DefaultExecutable = defaultTerraformExecutable()

// GetCommonOptions extracts commons terraform options
func GetCommonOptions(options *Options, args ...string) (*Options, []string) {
if options.TerraformBinary == "" {
options.TerraformBinary = defaultExecutable
options.TerraformBinary = DefaultExecutable
}

if options.TerraformBinary == "terragrunt" {
Expand Down
4 changes: 3 additions & 1 deletion modules/version-checker/version_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"fmt"
"regexp"

"github.com/gruntwork-io/terratest/modules/terraform"

"github.com/gruntwork-io/terratest/modules/shell"
"github.com/gruntwork-io/terratest/modules/testing"
"github.com/hashicorp/go-version"
Expand Down Expand Up @@ -125,7 +127,7 @@ func getBinary(params CheckVersionParams) (string, error) {
case Packer:
return "packer", nil
case Terraform:
return "terraform", nil
return terraform.DefaultExecutable, nil
default:
return "", fmt.Errorf("unsupported Binary for checking versions {%d}", params.Binary)
}
Expand Down

0 comments on commit a7af9cd

Please sign in to comment.