Skip to content

Commit

Permalink
add running versions logging
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody committed Aug 8, 2024
1 parent 44c2747 commit fff5742
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tflint-ruleset-blueprint/rules/terraform_required_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/hashicorp/go-version"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/terraform-linters/tflint-plugin-sdk/hclext"
"github.com/terraform-linters/tflint-plugin-sdk/logger"
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
)

Expand Down Expand Up @@ -63,20 +64,20 @@ func (r *TerraformRequiredVersion) Check(runner tflint.Runner) error {
if config.MinVersion != "" {
if _, err := version.NewSemver(config.MinVersion); err != nil {
return err
} else {
minVersion = config.MinVersion
}
minVersion = config.MinVersion
}

maxVersion := maximumTerraformRequiredVersion
if config.MaxVersion != "" {
if _, err := version.NewSemver(config.MaxVersion); err != nil {
return err
} else {
maxVersion = config.MaxVersion
}
maxVersion = config.MaxVersion
}

logger.Info(fmt.Sprintf("Running with min_version: %q max_version: %q", minVersion, maxVersion))

splitVersion := strings.Split(minVersion, ".")
majorVersion, err := strconv.Atoi(splitVersion[0])
if err != nil {
Expand Down

0 comments on commit fff5742

Please sign in to comment.