From cb13d0bb9462401bdbaabad7276a4de656ccaf48 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 18 Sep 2018 18:15:47 -0700 Subject: [PATCH] core: in testApplyFn, force attribute "id" to match ID field These two being distinct is an old-world concept, but we need to ensure that they match properly here to ensure that we don't leave dangling incorrect values for "id". --- terraform/context_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terraform/context_test.go b/terraform/context_test.go index 9e37c1d647..cd4b4b6a14 100644 --- a/terraform/context_test.go +++ b/terraform/context_test.go @@ -180,6 +180,11 @@ func testApplyFn( if d != nil { result = result.MergeDiff(d) } + + // The id attribute always matches ID for the sake of this mock + // implementation, since it's following the pre-0.12 assumptions where + // these two were treated as synonyms. + result.Attributes["id"] = result.ID return result, nil }