Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/16065.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
iambeta: fixed a permadiff that could occur in the `jwks_json` field for `google_iam_workload_identity_pool_provider` resource
```
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ func ValidateWorkloadIdentityPoolProviderId(v interface{}, k string) (ws []strin
return
}

func jwksJsonDiffSuppress(k, old, new string, d *schema.ResourceData) bool {
if old == "" || new == "" {
return old == new
}

var oldJson, newJson interface{}

if err := json.Unmarshal([]byte(old), &oldJson); err != nil {
return false
}

if err := json.Unmarshal([]byte(new), &newJson); err != nil {
return false
}

return reflect.DeepEqual(oldJson, newJson)
}

var (
_ = bytes.Clone
_ = context.WithCancel
Expand Down Expand Up @@ -305,9 +323,9 @@ https://iam.googleapis.com/projects/<project-number>/locations/<location>/worklo
},
},
"jwks_json": {
Type: schema.TypeString,
Optional: true,
StateFunc: func(v interface{}) string { s, _ := structure.NormalizeJsonString(v); return s },
Type: schema.TypeString,
Optional: true,
DiffSuppressFunc: jwksJsonDiffSuppress,
Description: `OIDC JWKs in JSON String format. For details on definition of a
JWK, see https:tools.ietf.org/html/rfc7517. If not set, then we
use the 'jwks_uri' from the discovery document fetched from the
Expand Down
Loading