Skip to content

Commit 40a8512

Browse files
committed
Fix passing optional booleans
1 parent 5eddcfa commit 40a8512

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

serverscom/resource_serverscom_cloud_computing_instance.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,11 @@ func resourceServerscomCloudComputingInstanceCreate(d *schema.ResourceData, meta
295295
input.GPNEnabled = &gpnEnabled
296296
}
297297

298-
if v, ok := d.GetOk("ipv4_enabled"); ok {
299-
ipv4Enabled := v.(bool)
300-
input.IPv4Enabled = &ipv4Enabled
301-
}
298+
ipv4Enabled := d.Get("ipv4_enabled").(bool)
299+
input.IPv4Enabled = &ipv4Enabled
302300

303-
if v, ok := d.GetOk("ipv6_enabled"); ok {
304-
ipv6Enabled := v.(bool)
305-
input.IPv6Enabled = &ipv6Enabled
306-
}
301+
ipv6Enabled := d.Get("ipv6_enabled").(bool)
302+
input.IPv6Enabled = &ipv6Enabled
307303

308304
if v, ok := d.GetOk("backup_copies"); ok {
309305
backupCopies := v.(int)

0 commit comments

Comments
 (0)