mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
ignore errors interpolating RawCount during apply
If a count field references another count field which is interpolated but is attached to a resource already in the state, the result of that first interpolation will be lost when a plan is serialized. This is because the result of the first interpolation is stored directly in the module config, in an unexported config field. This is not a general fix for the above situation, which would require refactoring how counts are handles throughout the config. Ignoring the error works, because in most cases the count will be properly handled during the resource's interpolation.
This commit is contained in:
parent
f3d1fb3aff
commit
a2718e4f79
@ -140,7 +140,10 @@ func (n *NodeApplyableResource) evalTreeDataResource(
|
||||
// Here we are just populating the interpolated value in-place
|
||||
// inside this RawConfig object, like we would in
|
||||
// NodeAbstractCountResource.
|
||||
&EvalInterpolate{Config: n.Config.RawCount},
|
||||
&EvalInterpolate{
|
||||
Config: n.Config.RawCount,
|
||||
ContinueOnErr: true,
|
||||
},
|
||||
|
||||
// We need to re-interpolate the config here, rather than
|
||||
// just using the diff's values directly, because we've
|
||||
@ -271,7 +274,10 @@ func (n *NodeApplyableResource) evalTreeManagedResource(
|
||||
// Here we are just populating the interpolated value in-place
|
||||
// inside this RawConfig object, like we would in
|
||||
// NodeAbstractCountResource.
|
||||
&EvalInterpolate{Config: n.Config.RawCount},
|
||||
&EvalInterpolate{
|
||||
Config: n.Config.RawCount,
|
||||
ContinueOnErr: true,
|
||||
},
|
||||
|
||||
&EvalInterpolate{
|
||||
Config: n.Config.RawConfig.Copy(),
|
||||
|
Loading…
Reference in New Issue
Block a user