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
reset resolved references if any reference cannot be resolved (#342)
Issue #, if available: aws-controllers-k8s/community#1342
Description of changes:
TL;DR:
* This change makes sure that partially resolved references do not get added to concrete resource inside `rm.ResolveReferences` unless all the references can be successfully resolved.
Detailed Version
* Inside `rm.ResolveReferences`, all the references are resolved sequentially and whenever any reference resolution fails it short circuits other reference resolutions.
* However the successfully resolved references, before the first fail one, get updated inside the concrete resource(ko).
* An error from `rm.ResolveReferences` causes the `HandleReconcilerError` to call PatchMetadataAndSpec, and the partial resolved references get persisted inside etcd.
* When the resolved references get persisted inside etcd, they cause the validation failure on next reconciler loop that both Ref and Id field cannot be present at the same time.
* The resolved references do not get persisted in etcd when reference resolution is successful because the desired object in memory get replaced by resolvedRefDesired and does not present resolved references as candidate for patch merge. During the failure desired object does not get replaced by resolvedRefDesired and presents the resolved references as patch candidate.
* We cannot update desired with resolvedRefDesired in an error case because then we will lose diff of ACK conditions added by `rm.ResolveReferences`.
* Ignoring the partially resolved reference during an error in `rm.ResolveReferences` is a clean and simple solution.
* I tested this by running apigatewayv2 tests locally.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
0 commit comments