Deploy healthcheck middleware as app

Using the healthcheck middleware as a filter is deprecated and
the middleware should be used as an application[1].
 [1] 6feaa13610c450c8486f969703768db5319b4846

This change updates definition and usage of the healthcheck middleware
accordingly to avoid the following deprecation warning.

DeprecationWarning: Using function/method 'Healthcheck.factory()' is
deprecated: The healthcheck middleware must now be configured as
an application, not as a filter.

Change-Id: Idf31c0ed5f433e42d26560d5d0022e53faeb6450
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
(cherry picked from commit e72d356a6d)
This commit is contained in:
Takashi Kajinami
2025-07-13 23:30:54 +09:00
committed by Pierre Riteau
parent e023e315da
commit 09b7e4e081
2 changed files with 20 additions and 7 deletions

View File

@@ -60,6 +60,9 @@ upgrade_project cloudkitty $RUN_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANC
# Migrate the database
upgrade_cloudkitty_database || die $LINO "ERROR in database migration"
# Update api_paste.ini for healthcheck middleware as app
cp $CLOUDKITTY_DIR$CLOUDKITTY_CONF_DIR/api_paste.ini $CLOUDKITTY_CONF_DIR
start_cloudkitty
# Don't succeed unless the services come up

View File

@@ -1,14 +1,24 @@
[pipeline:cloudkitty+noauth]
pipeline = cors healthcheck http_proxy_to_wsgi request_id ck_api
[composite:cloudkitty+noauth]
use = egg:Paste#urlmap
/: api+noauth
/healthcheck: healthcheck
[pipeline:cloudkitty+keystone]
pipeline = cors healthcheck http_proxy_to_wsgi request_id authtoken ck_api
[composite:cloudkitty+keystone]
use = egg:Paste#urlmap
/: api+keystone
/healthcheck: healthcheck
[pipeline:api+noauth]
pipeline = cors http_proxy_to_wsgi request_id ck_api
[pipeline:api+keystone]
pipeline = cors 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, /v2, /healthcheck
acl_public_routes = /, /v1, /v2
paste.filter_factory = cloudkitty.api.middleware:AuthTokenMiddleware.factory
[filter:request_id]
@@ -18,8 +28,8 @@ 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
[app:healthcheck]
paste.app_factory = oslo_middleware:Healthcheck.app_factory
backends = disable_by_file
disable_by_file_path = /etc/cloudkitty/healthcheck_disable