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
|
// When partial state mode is enabled, then only key prefixes specified
|
||||||
// by SetPartial will be in the final state. This allows providers to return
|
// by SetPartial will be in the final state. This allows providers to return
|
||||||
// partial states for partially applied resources (when errors occur).
|
// 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) {
|
func (d *ResourceData) Partial(on bool) {
|
||||||
d.partial = on
|
d.partial = on
|
||||||
if on {
|
if on {
|
||||||
|
if d.partialMap == nil {
|
||||||
d.partialMap = make(map[string]struct{})
|
d.partialMap = make(map[string]struct{})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
d.partialMap = nil
|
d.partialMap = nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue