From 09b7e4e081db00cf33c513287e1a0d5bddb4092b Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 13 Jul 2025 23:30:54 +0900 Subject: [PATCH] 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 (cherry picked from commit e72d356a6dd665a5747c965f5fcfc460aa98d305) --- devstack/upgrade/upgrade.sh | 3 +++ etc/cloudkitty/api_paste.ini | 24 +++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/devstack/upgrade/upgrade.sh b/devstack/upgrade/upgrade.sh index 273462c2..8b4dfa86 100755 --- a/devstack/upgrade/upgrade.sh +++ b/devstack/upgrade/upgrade.sh @@ -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 diff --git a/etc/cloudkitty/api_paste.ini b/etc/cloudkitty/api_paste.ini index c19a1f4e..a888c96c 100644 --- a/etc/cloudkitty/api_paste.ini +++ b/etc/cloudkitty/api_paste.ini @@ -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