mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
helper/schema: don't say that a set is computed if it exists
This commit is contained in:
parent
36f225dea0
commit
e5d64318bf
@ -304,6 +304,7 @@ func (d *ResourceData) getSet(
|
||||
return d.getList(k, parts, schema, source)
|
||||
}
|
||||
|
||||
result.Exists = raw.Exists
|
||||
return result
|
||||
}
|
||||
|
||||
|
@ -641,6 +641,32 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||
Err: false,
|
||||
},
|
||||
|
||||
{
|
||||
Schema: map[string]*Schema{
|
||||
"ports": &Schema{
|
||||
Type: TypeSet,
|
||||
Computed: true,
|
||||
Required: true,
|
||||
Elem: &Schema{Type: TypeInt},
|
||||
Set: func(a interface{}) int {
|
||||
return a.(int)
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
State: &terraform.InstanceState{
|
||||
Attributes: map[string]string{
|
||||
"ports.#": "0",
|
||||
},
|
||||
},
|
||||
|
||||
Config: nil,
|
||||
|
||||
Diff: nil,
|
||||
|
||||
Err: false,
|
||||
},
|
||||
|
||||
{
|
||||
Schema: map[string]*Schema{
|
||||
"ports": &Schema{
|
||||
|
Loading…
Reference in New Issue
Block a user