Fixed identity resource RawData idempotency

This commit is contained in:
Julien Dessaux 2023-09-25 00:06:41 +02:00
parent 6302c173a8
commit 68326c685f
Signed by: adyxax
GPG key ID: F92E51B86E07177E
5 changed files with 33 additions and 5 deletions

View 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
}