Fixed identity resource RawData idempotency
This commit is contained in:
parent
6302c173a8
commit
68326c685f
5 changed files with 33 additions and 5 deletions
17
internal/provider/utils.go
Normal file
17
internal/provider/utils.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package provider
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
func JSONRawDataEqual(a, b json.RawMessage) (bool, error) {
|
||||
var j, j2 interface{}
|
||||
if err := json.Unmarshal([]byte(a), &j); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if err := json.Unmarshal([]byte(b), &j2); err != nil {
|
||||
return false, err
|
||||
}
|
||||
return reflect.DeepEqual(j2, j), nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue