terraform: close transform should not include untargeted providers
This commit is contained in:
parent
9062a1893e
commit
ef546517be
|
@ -355,6 +355,13 @@ func (n *graphNodeCloseProvider) DotNode(name string, opts *dag.DotOpts) *dag.Do
|
|||
}
|
||||
}
|
||||
|
||||
// RemovableIfNotTargeted
|
||||
func (n *graphNodeCloseProvider) RemoveIfNotTargeted() bool {
|
||||
// We need to add this so that this node will be removed if
|
||||
// it isn't targeted or a dependency of a target.
|
||||
return true
|
||||
}
|
||||
|
||||
// graphNodeProviderConsumerDummy is a struct that never enters the real
|
||||
// graph (though it could to no ill effect). It implements
|
||||
// GraphNodeProviderConsumer and GraphNodeSubpath as a way to force
|
||||
|
|
|
@ -147,11 +147,7 @@ func TestCloseProviderTransformer_withTargets(t *testing.T) {
|
|||
}
|
||||
|
||||
actual := strings.TrimSpace(g.String())
|
||||
expected := strings.TrimSpace(`
|
||||
provider.aws
|
||||
provider.aws (close)
|
||||
provider.aws
|
||||
`)
|
||||
expected := strings.TrimSpace(``)
|
||||
if actual != expected {
|
||||
t.Fatalf("expected:%s\n\ngot:\n\n%s", expected, actual)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue