From 614806d59f0bca7131ff0706ce927e6cf9ba3421 Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Fri, 15 Jul 2016 13:15:47 -0600 Subject: [PATCH] helper/resource: Fix import test harness, which was modifying state Maps are reference types, it turns out :D --- helper/resource/testing_import_state.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/helper/resource/testing_import_state.go b/helper/resource/testing_import_state.go index f16f17130..00ec87324 100644 --- a/helper/resource/testing_import_state.go +++ b/helper/resource/testing_import_state.go @@ -90,8 +90,14 @@ func testStepImportState( } // Compare their attributes - actual := r.Primary.Attributes - expected := oldR.Primary.Attributes + actual := make(map[string]string) + for k, v := range r.Primary.Attributes { + actual[k] = v + } + expected := make(map[string]string) + for k, v := range oldR.Primary.Attributes { + expected[k] = v + } // Remove fields we're ignoring for _, v := range step.ImportStateVerifyIgnore {