mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-07-01 19:12:59 +00:00
fix(firewall): Improve firewall resources argument validation (#359)
Make sure VM / Container rules, SGs, IPSets are always include `node_name` along with `vm_id`, `container_id`.
This commit is contained in:
parent
9587c6383c
commit
8c1f246b5a
@ -33,11 +33,13 @@ func selectorSchema() map[string]*schema.Schema {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "The ID of the VM to manage the firewall for.",
|
||||
RequiredWith: []string{mkSelectorNodeName},
|
||||
},
|
||||
mkSelectorContainerID: {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "The ID of the container to manage the firewall for.",
|
||||
RequiredWith: []string{mkSelectorNodeName},
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -46,6 +48,9 @@ func selectorSchemaMandatory() map[string]*schema.Schema {
|
||||
s := selectorSchema()
|
||||
s[mkSelectorNodeName].Optional = false
|
||||
s[mkSelectorNodeName].Required = true
|
||||
// required attributes can't be included in RequiredWith
|
||||
s[mkSelectorVMID].RequiredWith = nil
|
||||
s[mkSelectorContainerID].RequiredWith = nil
|
||||
|
||||
return s
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user