config/configupgrade: Test to show that list unwrapping works for sets
This was already working but we had no tests to prove it.
This commit is contained in:
parent
929231a2e9
commit
b217624d83
|
@ -19,11 +19,7 @@ func (b *Block) DecoderSpec() hcldec.Spec {
|
|||
}
|
||||
|
||||
for name, attrS := range b.Attributes {
|
||||
ret[name] = &hcldec.AttrSpec{
|
||||
Name: name,
|
||||
Type: attrS.Type,
|
||||
Required: attrS.Required,
|
||||
}
|
||||
ret[name] = attrS.decoderSpec(name)
|
||||
}
|
||||
|
||||
for name, blockS := range b.BlockTypes {
|
||||
|
@ -103,3 +99,11 @@ func (b *Block) DecoderSpec() hcldec.Spec {
|
|||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (a *Attribute) decoderSpec(name string) hcldec.Spec {
|
||||
return &hcldec.AttrSpec{
|
||||
Name: name,
|
||||
Type: a.Type,
|
||||
Required: a.Required,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,18 @@ resource "test_instance" "bad4" {
|
|||
security_groups = ["${list("a", "b", "c")}"]
|
||||
}
|
||||
|
||||
resource "test_instance" "bad5" {
|
||||
security_groups = ["${test_instance.bad1.subnet_ids}"] # this one references a set
|
||||
}
|
||||
|
||||
resource "test_instance" "bad6" {
|
||||
subnet_ids = ["${test_instance.bad1.security_groups}"] # this one defines a set
|
||||
}
|
||||
|
||||
resource "test_instance" "bad7" {
|
||||
subnet_ids = ["${test_instance.bad1.*.id}"] # this one defines a set
|
||||
}
|
||||
|
||||
# The rest of these should keep the same amount of list-ness
|
||||
|
||||
resource "test_instance" "ok1" {
|
||||
|
|
|
@ -30,6 +30,18 @@ resource "test_instance" "bad4" {
|
|||
security_groups = ["a", "b", "c"]
|
||||
}
|
||||
|
||||
resource "test_instance" "bad5" {
|
||||
security_groups = test_instance.bad1.subnet_ids # this one references a set
|
||||
}
|
||||
|
||||
resource "test_instance" "bad6" {
|
||||
subnet_ids = test_instance.bad1.security_groups # this one defines a set
|
||||
}
|
||||
|
||||
resource "test_instance" "bad7" {
|
||||
subnet_ids = test_instance.bad1.*.id # this one defines a set
|
||||
}
|
||||
|
||||
# The rest of these should keep the same amount of list-ness
|
||||
|
||||
resource "test_instance" "ok1" {
|
||||
|
|
Loading…
Reference in New Issue