don't render plan for module outputs

Module outputs should not trigger plan rendering.
This commit is contained in:
James Bardin 2020-11-17 09:31:18 -05:00
parent 79fd81775e
commit 5f4ff0e8be
2 changed files with 26 additions and 1 deletions

View File

@ -39,7 +39,7 @@ func (c *Changes) Empty() bool {
}
for _, out := range c.Outputs {
if out.Action != NoOp {
if out.Addr.Module.IsRoot() && out.Action != NoOp {
return false
}
}

View File

@ -68,3 +68,28 @@ func TestProviderAddrs(t *testing.T) {
t.Error(problem)
}
}
// Module outputs should not effect the result of Empty
func TestModuleOutputChangesEmpty(t *testing.T) {
changes := &Changes{
Outputs: []*OutputChangeSrc{
{
Addr: addrs.AbsOutputValue{
Module: addrs.RootModuleInstance.Child("child", addrs.NoKey),
OutputValue: addrs.OutputValue{
Name: "output",
},
},
ChangeSrc: ChangeSrc{
Action: Update,
Before: []byte("a"),
After: []byte("b"),
},
},
},
}
if !changes.Empty() {
t.Fatal("plan has no visible changes")
}
}