Damans227 commented on code in PR #13315:
URL: https://github.com/apache/cloudstack/pull/13315#discussion_r4199306583
##########
server/src/main/java/com/cloud/network/router/NetworkHelperImpl.java:
##########
@@ -945,26 +945,8 @@ public boolean validateHAProxyLBRule(final
LoadBalancingRule rule) {
}
} else if
(LbStickinessMethod.StickinessMethodType.AppCookieBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName()))
{
- String length = null; // optional
- String holdTime = null; // optional
-
- for (final Pair<String, String> paramKV : paramsList) {
- final String key = paramKV.first();
- final String value = paramKV.second();
- if ("length".equalsIgnoreCase(key)) {
- length = value;
- }
- if ("holdtime".equalsIgnoreCase(key)) {
- holdTime = value;
- }
- }
-
- if (length != null && !containsOnlyNumbers(length, null)) {
- throw new
InvalidParameterValueException(String.format("Failed LB in validation rule id:
%s Cause: length is not a number: %s", rule.getLb(), length));
- }
- if (holdTime != null && !containsOnlyNumbers(holdTime,
timeEndChar) && !containsOnlyNumbers(holdTime, null)) {
- throw new
InvalidParameterValueException(String.format("Failed LB in validation rule id:
%s Cause: holdtime is not in timeformat: %s", rule.getLb(), holdTime));
- }
+ throw new InvalidParameterValueException(String.format("Failed
LB in validation rule: %s Cause: AppCookie based stickiness "
Review Comment:
what happens to lb rules that already have an app cookie policy? looks like
editing them will now fail until someone removes the policy
##########
server/src/main/java/com/cloud/network/router/NetworkHelperImpl.java:
##########
@@ -945,26 +945,8 @@ public boolean validateHAProxyLBRule(final
LoadBalancingRule rule) {
}
} else if
(LbStickinessMethod.StickinessMethodType.AppCookieBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName()))
{
- String length = null; // optional
- String holdTime = null; // optional
-
- for (final Pair<String, String> paramKV : paramsList) {
- final String key = paramKV.first();
- final String value = paramKV.second();
- if ("length".equalsIgnoreCase(key)) {
- length = value;
- }
- if ("holdtime".equalsIgnoreCase(key)) {
- holdTime = value;
- }
- }
-
- if (length != null && !containsOnlyNumbers(length, null)) {
- throw new
InvalidParameterValueException(String.format("Failed LB in validation rule id:
%s Cause: length is not a number: %s", rule.getLb(), length));
- }
- if (holdTime != null && !containsOnlyNumbers(holdTime,
timeEndChar) && !containsOnlyNumbers(holdTime, null)) {
- throw new
InvalidParameterValueException(String.format("Failed LB in validation rule id:
%s Cause: holdtime is not in timeformat: %s", rule.getLb(), holdTime));
- }
+ throw new InvalidParameterValueException(String.format("Failed
LB in validation rule: %s Cause: AppCookie based stickiness "
+ + "(HAProxy 'appsession') is not supported on a
Virtual Router, as this directive was removed in HAProxy 1.6", rule.getLb()));
Review Comment:
should we also drop app cookie from the list of methods the router says it
supports? right now the ui still offers it and then it fails here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]