Added support for annotation session-cookie-change-on-failure
1. Session cookie is updated on previous attempt failure when `session-cookie-change-on-failure = true` (default value is `false`). 2. Added tests to check both cases. 3. Updated docs. Co-Authored-By: Vladimir Grishin <yadolov@users.noreply.github.com>
This commit is contained in:
parent
24cb0e5d0b
commit
254629cf16
9 changed files with 179 additions and 21 deletions
|
|
@ -71,6 +71,7 @@ func TestIngressAffinityCookieConfig(t *testing.T) {
|
|||
data[parser.GetAnnotationWithPrefix(annotationAffinityCookieExpires)] = "4500"
|
||||
data[parser.GetAnnotationWithPrefix(annotationAffinityCookieMaxAge)] = "3000"
|
||||
data[parser.GetAnnotationWithPrefix(annotationAffinityCookiePath)] = "/foo"
|
||||
data[parser.GetAnnotationWithPrefix(annotationAffinityCookieChangeOnFailure)] = "true"
|
||||
ing.SetAnnotations(data)
|
||||
|
||||
affin, _ := NewParser(&resolver.Mock{}).Parse(ing)
|
||||
|
|
@ -98,4 +99,8 @@ func TestIngressAffinityCookieConfig(t *testing.T) {
|
|||
if nginxAffinity.Cookie.Path != "/foo" {
|
||||
t.Errorf("expected /foo as session-cookie-path but returned %v", nginxAffinity.Cookie.Path)
|
||||
}
|
||||
|
||||
if nginxAffinity.Cookie.ChangeOnFailure != "true" {
|
||||
t.Errorf("expected change of failure parameter set to true but returned %v", nginxAffinity.Cookie.ChangeOnFailure)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue