mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #4617 from ebsco/master
Fix to not put fixed_ip in request if not defined
This commit is contained in:
commit
f1b55de7c8
@ -245,8 +245,13 @@ func resourcePortSecurityGroupsV2(d *schema.ResourceData) []string {
|
|||||||
return groups
|
return groups
|
||||||
}
|
}
|
||||||
|
|
||||||
func resourcePortFixedIpsV2(d *schema.ResourceData) []ports.IP {
|
func resourcePortFixedIpsV2(d *schema.ResourceData) interface{} {
|
||||||
rawIP := d.Get("fixed_ip").([]interface{})
|
rawIP := d.Get("fixed_ip").([]interface{})
|
||||||
|
|
||||||
|
if len(rawIP) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
ip := make([]ports.IP, len(rawIP))
|
ip := make([]ports.IP, len(rawIP))
|
||||||
for i, raw := range rawIP {
|
for i, raw := range rawIP {
|
||||||
rawMap := raw.(map[string]interface{})
|
rawMap := raw.(map[string]interface{})
|
||||||
@ -255,8 +260,8 @@ func resourcePortFixedIpsV2(d *schema.ResourceData) []ports.IP {
|
|||||||
IPAddress: rawMap["ip_address"].(string),
|
IPAddress: rawMap["ip_address"].(string),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ip
|
return ip
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func resourcePortAdminStateUpV2(d *schema.ResourceData) *bool {
|
func resourcePortAdminStateUpV2(d *schema.ResourceData) *bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user