cloudstack
cloudstack copied to clipboard
Load balancer protocols bug
ISSUE TYPE
- Bug Report
- Improvement Request
COMPONENT NAME
- ACS 4.11 VR load balancer
- ACS 4.11 CreateLoadBalancerRule API call
CLOUDSTACK VERSION
- ACS 4.11.x
CONFIGURATION
- Advanced zone
- Isolated guest network
- Load balancer rules
OS / ENVIRONMENT
- N/A
SUMMARY
- Load balancer protocols for UDP and TCP-proxy are not labelled correctly in the GUI:
**
** Note label is label.lb.protocol_udp / label.lb.protocol_tcp-proxy (underscores used to signify the inserted space)
** Whatever protocol is chosen is persisted in the DB with the above strings. - However HAproxy and iptables configuration will always be configured with "TCP".
- This may or may not be down to two protocol parameters here: https://github.com/apache/cloudstack/blob/4.11.2.0/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java#L316 where the first one is always set to "TCP"
STEPS TO REPRODUCE
- Create LB rule using each protocol
- Observe the configuration which ends up on the HAproxy configuration on the VR does NOT change and always uses TCP.
EXPECTED RESULTS
- Protocols UDP and TCP-proxy being honoured
ACTUAL RESULTS
- All LB rules are configured as TCP.
This exists in master:
ui/l10n/en.js:"label.lb.protocol.http":"HTTP",
ui/l10n/en.js:"label.lb.protocol.ssl":"SSL",
ui/l10n/en.js:"label.lb.protocol.tcp":"TCP",
ui/l10n/en.js:"label.lb.protocol.udp":"UDP",
I believe that the issue is here: https://github.com/apache/cloudstack/blob/master/ui/scripts/network.js#L6846-L6862

Enumerating the protocols is introducting a space after '.protocol.', the label cannot then be resolved by the language files.
var protocols = protocolCapabilities.value.split(',');
if (!protocols) {
return [];
}
var data = [];
$(protocols).each(function() {
data.push({id: this.valueOf(), name: this.valueOf(), description: _l('label.lb.protocol.' + this.valueOf())});
});
Did a quick fix replacing spaces but only half fixed it:

maybe the other half is in the actual label missing.
right i am; 'tcp.proxy' and 'tcp-proxy' are used interchangably. will create a PR to try and unify