stackplan: Use comparable version strings for plan version checking

Previously we were comparing version.String() with version.SemVer.String(),
which doesn't match because the latter excludes any prerelease version
suffix.
pull/34738/head
Martin Atkins 3 years ago
parent 385e37cae2
commit 3c5a2ea7e5

@ -32,7 +32,7 @@ func LoadFromProto(msgs []*anypb.Any) (*Plan, error) {
switch msg := msg.(type) {
case *tfstackdata1.PlanHeader:
wantVersion := version.String()
wantVersion := version.SemVer.String()
gotVersion := msg.TerraformVersion
if gotVersion != wantVersion {
return nil, fmt.Errorf("plan was created by Terraform %s, but this is Terraform %s", gotVersion, wantVersion)

Loading…
Cancel
Save