octavia/octavia/tests/functional
Cédric Jeanneret 9922248a89 Save the HAProxy state outside of its systemd unit
By default, SELinux prevents HAProxy context (haproxy_t) to execute
shell context (shell_exec_t) for security reasons.

This prevents HAProxy to actually reload properly, since SELinux will
deny its call to a shell to save its state to a file.

In order to avoid opening a potential security hole in the load-balancer
image, the best way is to generate the state file before the actual
reload.

There are more details about the SELinux denials in the associated Red
Hat Bugzilla.

 Conflicts:
	octavia/amphorae/backends/utils/haproxy_query.py

 Fixed in this backport:
   - A compatibility issue with Python 2.7
     (open() didn't have an encoding kwarg)
   - save_state() tried to use Exception().output, which in general
     causes an AttributeError

Resolves: rhbz#2073491
Change-Id: I6b9a5e1e3bafe77ad9f9506b8c0995d8c2a00081
(cherry picked from commit 21d74c373b)
(cherry picked from commit 0a062cd664)
(cherry picked from commit edcd6931fc)
(cherry picked from commit 97ac37bc6e)
(cherry picked from commit d4f2de8ba8)
(cherry picked from commit 86672909d4)
2022-04-21 11:36:38 +02:00
..
amphorae Save the HAProxy state outside of its systemd unit 2022-04-21 11:36:38 +02:00
api Fix MAX_TIMEOUT value for listener 2021-09-15 08:41:20 +02:00
db Ignore DELETED amphorae when performing certificate rotation 2020-11-26 00:08:54 +00:00
__init__.py Add license for empty __init__.py 2018-03-14 07:02:56 +09:00