Skip to content

Commit ed26472

Browse files
committed
set maxconn
1 parent b145934 commit ed26472

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cloudstack/resource_cloudstack_network_offering.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,11 @@ func resourceCloudStackNetworkOfferingRead(d *schema.ResourceData, meta interfac
384384
if _, ok := d.GetOk("routing_mode"); ok {
385385
d.Set("routing_mode", n.Routingmode)
386386
}
387-
if _, ok := d.GetOk("max_connections"); ok {
387+
// Set max_connections if it was specified in the configuration
388+
// Note: CloudStack may return 0 even when a value was set, so we preserve the configured value
389+
if configuredMaxConn := d.Get("max_connections").(int); configuredMaxConn != 0 {
390+
d.Set("max_connections", configuredMaxConn)
391+
} else if n.Maxconnections != 0 {
388392
d.Set("max_connections", n.Maxconnections)
389393
}
390394

0 commit comments

Comments
 (0)