File: add-healthcheck.patch

package info (click to toggle)
cloudkitty 13.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,888 kB
  • sloc: python: 16,997; sh: 372; makefile: 218; pascal: 54
file content (47 lines) | stat: -rw-r--r-- 1,680 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Description: Add a /healthcheck URL
 This is useful for operators to setup haproxy and know that one of
 the API is alive. I've done such a patch on many other projects,
 and this is unifying all.
Author: Thomas Goirand <zigo@debian.org>
Date: Tue, 16 Jun 2020 14:55:58 +0200
Change-Id: I14214679849c1cd378c7487254761f1d4d73e10e
Forwarded: https://review.opendev.org/735903
Last-Update: 2020-06-16

diff --git a/etc/cloudkitty/api_paste.ini b/etc/cloudkitty/api_paste.ini
index 0ff20277..8ae1e68f 100644
--- a/etc/cloudkitty/api_paste.ini
+++ b/etc/cloudkitty/api_paste.ini
@@ -1,14 +1,14 @@
 [pipeline:cloudkitty+noauth]
-pipeline = cors http_proxy_to_wsgi request_id ck_api
+pipeline = cors healthcheck http_proxy_to_wsgi request_id ck_api
 
 [pipeline:cloudkitty+keystone]
-pipeline = cors http_proxy_to_wsgi request_id authtoken ck_api
+pipeline = cors healthcheck http_proxy_to_wsgi request_id authtoken ck_api
 
 [app:ck_api]
 paste.app_factory = cloudkitty.api.app:app_factory
 
 [filter:authtoken]
-acl_public_routes = /, /v1
+acl_public_routes = /, /v1, /healthcheck
 paste.filter_factory = cloudkitty.api.middleware:AuthTokenMiddleware.factory
 
 [filter:request_id]
@@ -18,6 +18,11 @@ paste.filter_factory = oslo_middleware:RequestId.factory
 paste.filter_factory =  oslo_middleware.cors:filter_factory
 oslo_config_project = cloudkitty
 
+[filter:healthcheck]
+paste.filter_factory = oslo_middleware:Healthcheck.factory
+backends = disable_by_file
+disable_by_file_path = /etc/cloudkitty/healthcheck_disable
+
 [filter:http_proxy_to_wsgi]
 paste.filter_factory = oslo_middleware.http_proxy_to_wsgi:HTTPProxyToWSGI.factory
 oslo_config_project = cloudkitty
-- 
2.20.1