don't render plan for module outputs
Module outputs should not trigger plan rendering.
This commit is contained in:
parent
79fd81775e
commit
5f4ff0e8be
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue