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
Introduced with #237
When management policies are enabled, we are using the spec.initProvider field, and merging it to spec.forProvider. In addition,
we are calculating the fields which are part of spec.initProvider but not spec.forProvider and setting those fields into ignore_changes lifecycle hooks.
The issue here is that we are using mergo in a way that spec.initProvider fields override spec.forProvder fields:
// TODO(lsviben): Currently initProvider fields override forProvider// fields if set. It should be the other way around.// merge the initProvider and forProvider parameterserr=mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy)
iferr!=nil {
returnnil, errors.Wrap(err, "cannot merge init and forProvider parameters")
}
This is due to using mergo.WithSliceDeepCopy which is on the other hand needed to merge arrays.
Ideally, spec.forProvider fields would take precedence over the spec.initProvider ones. Maybe there is an option with mergo to do something like that, or it wont be difficult to write ourselves.
But, as we don't recommenced or expect the same fields to be set, we could also error out if they set the same fields.
The text was updated successfully, but these errors were encountered:
Introduced with #237
When management policies are enabled, we are using the
spec.initProvider
field, and merging it tospec.forProvider
. In addition,we are calculating the fields which are part of
spec.initProvider
but notspec.forProvider
and setting those fields intoignore_changes
lifecycle hooks.The issue here is that we are using mergo in a way that
spec.initProvider
fields overridespec.forProvder
fields:This is due to using
mergo.WithSliceDeepCopy
which is on the other hand needed to merge arrays.Ideally,
spec.forProvider
fields would take precedence over thespec.initProvider
ones. Maybe there is an option with mergo to do something like that, or it wont be difficult to write ourselves.But, as we don't recommenced or expect the same fields to be set, we could also error out if they set the same fields.
The text was updated successfully, but these errors were encountered: