Repository navigation
Reject AppCookie LB stickiness policy on Virtual Router networks #13315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9111855
5bdd22a
7404a52
46864a0
e91b9e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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())); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. appcookie has been deprecated by haproxy, but I am not sure if other solutions (network plugins) support it |
||
| } | ||
| } | ||
| return true; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens to lb rules that already have an app cookie policy? looks like editing them will now fail until someone removes the policy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appcookie has been deprecated in haproxy from several versions ago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, those rules already break the router config today so a clear error on edit is better