You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need the ability to detect whether there are any differences in a
resource's fields *other than* a particular one. Basically, in doing the
tagging work for DBInstance, I came across a problem where we were
calling the ModifyDBInstance API call even though there were no changes
to DBInstance Spec fields *other than* the Tags collection.
So, I need to add the following in an sdk_update_pre_build_request
template for DBInstance:
```go
if delta.DifferentAt("Spec.Tags") {
if err = rm.SyncTags(ctx, desired, latest); err != nil {
return nil, err
}
}
if !delta.DifferentExcept("Spec.Tags") {
// We don't want to proceed to call the ModifyDBInstance API since
// no other resource fields have changed.
return desired, nil
}
```
This PR adds the `delta.DifferentExcept()` implementation to enable the
above code.
Issue aws-controllers-k8s/community#1276
Signed-off-by: Jay Pipes <[email protected]>
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
0 commit comments