update comment and fix core test
One terraform test was broken when the result became more correct.
This commit is contained in:
parent
93d78c4ee7
commit
273f20ec8b
|
@ -2267,12 +2267,12 @@ func TestContext2Plan_computedMultiIndex(t *testing.T) {
|
||||||
case "aws_instance.foo[0]":
|
case "aws_instance.foo[0]":
|
||||||
checkVals(t, objectVal(t, schema, map[string]cty.Value{
|
checkVals(t, objectVal(t, schema, map[string]cty.Value{
|
||||||
"ip": cty.UnknownVal(cty.List(cty.String)),
|
"ip": cty.UnknownVal(cty.List(cty.String)),
|
||||||
"foo": cty.ListValEmpty(cty.String),
|
"foo": cty.NullVal(cty.List(cty.String)),
|
||||||
}), ric.After)
|
}), ric.After)
|
||||||
case "aws_instance.foo[1]":
|
case "aws_instance.foo[1]":
|
||||||
checkVals(t, objectVal(t, schema, map[string]cty.Value{
|
checkVals(t, objectVal(t, schema, map[string]cty.Value{
|
||||||
"ip": cty.UnknownVal(cty.List(cty.String)),
|
"ip": cty.UnknownVal(cty.List(cty.String)),
|
||||||
"foo": cty.ListValEmpty(cty.String),
|
"foo": cty.NullVal(cty.List(cty.String)),
|
||||||
}), ric.After)
|
}), ric.After)
|
||||||
case "aws_instance.bar[0]":
|
case "aws_instance.bar[0]":
|
||||||
checkVals(t, objectVal(t, schema, map[string]cty.Value{
|
checkVals(t, objectVal(t, schema, map[string]cty.Value{
|
||||||
|
|
|
@ -497,7 +497,8 @@ func (d *InstanceDiff) blockDiff(path []string, attrs map[string]string, schema
|
||||||
|
|
||||||
// we can only trust the diff for sets, since the path changes, so don't
|
// we can only trust the diff for sets, since the path changes, so don't
|
||||||
// count existing values as candidate keys. If it turns out we're
|
// count existing values as candidate keys. If it turns out we're
|
||||||
// keeping the
|
// keeping the attributes, we will check catch it down below with
|
||||||
|
// "keepBlock" after we check the set count.
|
||||||
if block.Nesting != configschema.NestingSet {
|
if block.Nesting != configschema.NestingSet {
|
||||||
for k := range attrs {
|
for k := range attrs {
|
||||||
if strings.HasPrefix(k, blockKey) {
|
if strings.HasPrefix(k, blockKey) {
|
||||||
|
|
Loading…
Reference in New Issue