make Changes.Empty() not count NoOps

This make the plan `Empty` concept more closely match the legacy diff
behavior.

Remove old unknown field from plan_test
This commit is contained in:
James Bardin 2018-09-14 18:39:09 -04:00 committed by Martin Atkins
parent 103c160a47
commit b738cdb19f
2 changed files with 6 additions and 2 deletions

View File

@ -32,7 +32,12 @@ func NewChanges() *Changes {
}
func (c *Changes) Empty() bool {
return (len(c.Resources) + len(c.Outputs)) == 0
for _, res := range c.Resources {
if res.Action != NoOp {
return false
}
}
return true
}
// ResourceInstance returns the planned change for the current object of the

View File

@ -13,7 +13,6 @@ func TestProviderAddrs(t *testing.T) {
plan := &Plan{
VariableValues: map[string]DynamicValue{},
Changes: &Changes{
RootOutputs: map[string]*OutputChangeSrc{},
Resources: []*ResourceInstanceChangeSrc{
{
Addr: addrs.Resource{