Skip to content

Commit

Permalink
fix: provider source is not case sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-FFFFFF authored and lonegunmanb committed Jul 16, 2024
1 parent 6767003 commit 2fb06dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rules/provider_minimum_major_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package rules

import (
"fmt"
"strings"

goverison "github.com/hashicorp/go-version"
"github.com/terraform-linters/tflint-plugin-sdk/hclext"
Expand Down Expand Up @@ -89,7 +90,7 @@ func (m *ProviderVersionRule) Check(r tflint.Runner) error {
if err = r.EvaluateExpr(providerAttr.Expr, &provider, &tflint.EvaluateExprOption{WantType: &wantType}); err != nil {
return err
}
if provider.Source != m.ProviderSource {
if !strings.EqualFold(provider.Source, m.ProviderSource) {
return r.EmitIssue(m, fmt.Sprintf("provider `%s`'s source should be %s, got %s", m.ProviderName, m.ProviderSource, provider.Source), providerAttr.Range)
}
constraint, err := goverison.NewConstraint(provider.Version)
Expand Down

0 comments on commit 2fb06dd

Please sign in to comment.