mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
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:
parent
e3a6e1f6e8
commit
d6f0d1ea57
@ -28,6 +28,9 @@ type ConfigTransformer struct {
|
|||||||
// Mode will only add resources that match the given mode
|
// Mode will only add resources that match the given mode
|
||||||
ModeFilter bool
|
ModeFilter bool
|
||||||
Mode addrs.ResourceMode
|
Mode addrs.ResourceMode
|
||||||
|
|
||||||
|
// destroyPlan indicated this is being called from a destroy plan.
|
||||||
|
destroyPlan bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *ConfigTransformer) Transform(g *Graph) error {
|
func (t *ConfigTransformer) Transform(g *Graph) error {
|
||||||
@ -36,6 +39,11 @@ func (t *ConfigTransformer) Transform(g *Graph) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Configured resource are not added for a destroy plan
|
||||||
|
if t.destroyPlan {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Start the transformation process
|
// Start the transformation process
|
||||||
return t.transform(g, t.Config)
|
return t.transform(g, t.Config)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user