Merge "Fix cookie session persistence in namespace driver"

This commit is contained in:
Zuul 2018-07-13 02:56:39 +00:00 committed by Gerrit Code Review
commit d582fc52c7
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 %} {% elif pool.session_persistence.type == constants.SESSION_PERSISTENCE_HTTP_COOKIE %}
cookie SRV insert indirect nocache cookie SRV insert indirect nocache
{% elif pool.session_persistence.type == constants.SESSION_PERSISTENCE_APP_COOKIE and pool.session_persistence.cookie_name %} {% 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 %}
{% endif %} {% endif %}
{% if pool.health_monitor %} {% if pool.health_monitor %}

View File

@ -283,7 +283,9 @@ class TestHaproxyCfg(base.BaseTestCase):
be = ("backend sample_pool_id_1\n" be = ("backend sample_pool_id_1\n"
" mode http\n" " mode http\n"
" balance roundrobin\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" " timeout check 31s\n"
" option httpchk GET /index.html\n" " option httpchk GET /index.html\n"
" http-check expect rstatus %s\n" " http-check expect rstatus %s\n"