missed .% suffixes in diff.Apply

Diff.Apply checks for unneeded container count diffs, but was missing
the check for maps.

Add an early return for planning a destroy.
This commit is contained in:
James Bardin 2019-02-13 19:01:55 -05:00
parent 931f459336
commit c34c37fbd5
2 changed files with 7 additions and 1 deletions

View File

@ -498,6 +498,12 @@ func (s *GRPCProviderServer) PlanResourceChange(_ context.Context, req *proto.Pl
return resp, nil
}
// We don't usually plan destroys, but this can return early in any case.
if proposedNewStateVal.IsNull() {
resp.PlannedState = req.ProposedNewState
return resp, nil
}
info := &terraform.InstanceInfo{
Type: req.TypeName,
}

View File

@ -546,7 +546,7 @@ func (d *InstanceDiff) applyBlockDiff(path []string, attrs map[string]string, sc
}
// check for empty "count" keys
if strings.HasSuffix(attr, ".#") && diff.New == "0" {
if (strings.HasSuffix(attr, ".#") || strings.HasSuffix(attr, ".%")) && diff.New == "0" {
continue
}