Fix cookie session persistence in namespace driver

The old namespace driver was using, the long deprecated, appsession
option for APP_COOKIE session persistence. This fails on HAProxy 1.6
and later.
This patch moves that over to the modern stick table method.

Change-Id: I834958f711525c08fad12e280abc308820b20521
Story: 1640882
Task: 5321
This commit is contained in:
Michael Johnson 2018-07-05 21:34:19 -07:00
parent fd55125641
commit 1e2a93a4a5
2 changed files with 6 additions and 2 deletions

View File

@ -69,7 +69,9 @@ backend {{ pool.id }}
{% elif pool.session_persistence.type == constants.SESSION_PERSISTENCE_HTTP_COOKIE %}
cookie SRV insert indirect nocache
{% elif pool.session_persistence.type == constants.SESSION_PERSISTENCE_APP_COOKIE and pool.session_persistence.cookie_name %}
appsession {{ pool.session_persistence.cookie_name }} len 56 timeout 3h
stick-table type string len 64 size 10k
stick store-response res.cook({{ pool.session_persistence.cookie_name }})
stick match req.cook({{ pool.session_persistence.cookie_name }})
{% endif %}
{% endif %}
{% if pool.health_monitor %}

View File

@ -283,7 +283,9 @@ class TestHaproxyCfg(base.BaseTestCase):
be = ("backend sample_pool_id_1\n"
" mode http\n"
" balance roundrobin\n"
" appsession APP_COOKIE len 56 timeout 3h\n"
" stick-table type string len 64 size 10k\n"
" stick store-response res.cook(APP_COOKIE)\n"
" stick match req.cook(APP_COOKIE)\n"
" timeout check 31s\n"
" option httpchk GET /index.html\n"
" http-check expect rstatus %s\n"