add provider metas to destroy plan

This commit is contained in:
James Bardin 2022-06-02 09:10:37 -04:00
parent ccd2c7820a
commit acba1159e4

View File

@ -422,6 +422,12 @@ func (n *NodeAbstractResourceInstance) planDestroy(ctx EvalContext, currentState
return plan, diags.Append(err) return plan, diags.Append(err)
} }
metaConfigVal, metaDiags := n.providerMetas(ctx)
diags = diags.Append(metaDiags)
if diags.HasErrors() {
return plan, diags
}
// Allow the provider to check the destroy plan, and insert any necessary // Allow the provider to check the destroy plan, and insert any necessary
// private data. // private data.
resp := provider.PlanResourceChange(providers.PlanResourceChangeRequest{ resp := provider.PlanResourceChange(providers.PlanResourceChangeRequest{
@ -430,6 +436,7 @@ func (n *NodeAbstractResourceInstance) planDestroy(ctx EvalContext, currentState
PriorState: unmarkedPriorVal, PriorState: unmarkedPriorVal,
ProposedNewState: nullVal, ProposedNewState: nullVal,
PriorPrivate: currentState.Private, PriorPrivate: currentState.Private,
ProviderMeta: metaConfigVal,
}) })
// We may not have a config for all destroys, but we want to reference it in // We may not have a config for all destroys, but we want to reference it in