From 3c5a2ea7e599d22e986fbdd5c930bf37ed99dd60 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Fri, 22 Sep 2023 17:42:14 -0700 Subject: [PATCH] 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. --- internal/stacks/stackplan/from_proto.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/stacks/stackplan/from_proto.go b/internal/stacks/stackplan/from_proto.go index 448121260e..bd2b10a9e9 100644 --- a/internal/stacks/stackplan/from_proto.go +++ b/internal/stacks/stackplan/from_proto.go @@ -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)