don't add config nodes during destroy plan

We want to use the normal plan graph for destroy, so we need to flag off
configuration for that process.
This commit is contained in:
James Bardin 2022-05-27 10:55:38 -04:00
parent e3a6e1f6e8
commit d6f0d1ea57

View File

@ -28,6 +28,9 @@ type ConfigTransformer struct {
// Mode will only add resources that match the given mode
ModeFilter bool
Mode addrs.ResourceMode
// destroyPlan indicated this is being called from a destroy plan.
destroyPlan bool
}
func (t *ConfigTransformer) Transform(g *Graph) error {
@ -36,6 +39,11 @@ func (t *ConfigTransformer) Transform(g *Graph) error {
return nil
}
// Configured resource are not added for a destroy plan
if t.destroyPlan {
return nil
}
// Start the transformation process
return t.transform(g, t.Config)
}