From 0db9d98fff5ffc0f305d15ca3cfc51e6180afd81 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 8 Oct 2014 16:35:14 -0700 Subject: [PATCH] helper/schema: can set Partial(true) multiple times --- helper/schema/resource_data.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/helper/schema/resource_data.go b/helper/schema/resource_data.go index e22c6e10d7..69ac090b37 100644 --- a/helper/schema/resource_data.go +++ b/helper/schema/resource_data.go @@ -114,13 +114,12 @@ func (d *ResourceData) HasChange(key string) bool { // When partial state mode is enabled, then only key prefixes specified // by SetPartial will be in the final state. This allows providers to return // partial states for partially applied resources (when errors occur). -// -// When partial state mode is toggled, the map of enabled partial states -// (by SetPartial) is reset. func (d *ResourceData) Partial(on bool) { d.partial = on if on { - d.partialMap = make(map[string]struct{}) + if d.partialMap == nil { + d.partialMap = make(map[string]struct{}) + } } else { d.partialMap = nil }