helper/schema: can set Partial(true) multiple times
This commit is contained in:
parent
dd036b0399
commit
0db9d98fff
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue