Merge pull request #19704 from hashicorp/svh/f-versions
backend/remote: compare versions without the prerelease
This commit is contained in:
commit
687ba2907d
|
@ -370,7 +370,7 @@ func (b *Remote) checkConstraints(c *disco.Constraints) tfdiags.Diagnostics {
|
|||
}
|
||||
|
||||
// Create the version to check.
|
||||
v, err := version.NewVersion(tfversion.String())
|
||||
v, err := version.NewVersion(tfversion.Version)
|
||||
if err != nil {
|
||||
return diags.Append(checkConstraintsWarning(err))
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ func (b *Remote) checkConstraints(c *disco.Constraints) tfdiags.Diagnostics {
|
|||
summary := fmt.Sprintf("Incompatible Terraform version v%s", v.String())
|
||||
details := fmt.Sprintf(
|
||||
"The configured Terraform Enterprise backend is compatible with Terraform "+
|
||||
"versions >= %s, < %s%s.", c.Minimum, c.Maximum, excluding,
|
||||
"versions >= %s, <= %s%s.", c.Minimum, c.Maximum, excluding,
|
||||
)
|
||||
|
||||
if action != "" && toVersion != "" {
|
||||
|
|
|
@ -379,7 +379,7 @@ func TestRemote_checkConstraints(t *testing.T) {
|
|||
Maximum: "0.11.11",
|
||||
},
|
||||
version: "0.10.1",
|
||||
result: "versions >= 0.11.0, < 0.11.11.",
|
||||
result: "versions >= 0.11.0, <= 0.11.11.",
|
||||
},
|
||||
"list exclusion": {
|
||||
constraints: &disco.Constraints{
|
||||
|
|
Loading…
Reference in New Issue