Skip to content

Commit c14183b

Browse files
committed
Merge pull request apache#1337 from nitin-maharana/CloudStack-Nitin20_4.7
CLOUDSTACK-9235: Autoscale button is missing in VPCAutoscale button is missing. This should not be the case since we are able to add NS as the external LB provider in VPC. Steps: ===== 1. Create a VPC offering with NS as the external LB provider 2. Create a VPC and configure the public tier with the above offering 3. Acquire an IP address and try to configure Load Balancing rule Result: ====== Autoscale option is not visible at all for the LB. Expected Result: ============= Autoscale option should be available and should work exactly like the way it works for a normal isolated network with NS. If we choose NS as service provider for LB, autoscale should also be visible. If VR is chosen, only then we should not display autoscale. Fix: === In case of VPC, it checks the services available. If LB is there, It checks the provider is Netscaler then it shows the button or hides it. * pr/1337: CLOUDSTACK-9235: Autoscale button is missing in VPC Signed-off-by: Remi Bergsma <github@remi.nl>
2 parents c99f57f + b02e9f0 commit c14183b

1 file changed

Lines changed: 11 additions & 18 deletions

File tree

ui/scripts/network.js

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,22 +3673,7 @@
36733673
success: function(json) {
36743674
var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
36753675
var services = networkOffering.service;
3676-
if (services != null) {
3677-
for (var i = 0; i < services.length; i++) {
3678-
if (services[i].name == 'Lb') {
3679-
var providers = services[i].provider;
3680-
if (providers != null) {
3681-
for (var k = 0; k < providers.length; k++) {
3682-
if (providers[k].name == 'Netscaler') {
3683-
lbProviderIsNetscaler = true;
3684-
break;
3685-
}
3686-
}
3687-
}
3688-
break;
3689-
}
3690-
}
3691-
}
3676+
lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services);
36923677
}
36933678
});
36943679
if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
@@ -3697,8 +3682,16 @@
36973682
return 2; //hide Autoscale button (both header and form)
36983683
}
36993684
} else { //from VPC section
3700-
//VPC doesn't support autoscale
3701-
return 2;
3685+
var lbProviderIsNetscaler;
3686+
var services = args.context.vpc[0].service;
3687+
3688+
lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services);
3689+
3690+
if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
3691+
return false; //show AutoScale button
3692+
} else {
3693+
return 2; //hide Autoscale button (both header and form)
3694+
}
37023695
}
37033696
}
37043697
},

0 commit comments

Comments
 (0)