This is an automated email from the ASF dual-hosted git repository.

shreemaanabhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 827d4ba73 feat: standalone mode status api (#12810)
827d4ba73 is described below

commit 827d4ba73484c25e615e50a8f17aa175f1aabcd1
Author: Shreemaan Abhishek <[email protected]>
AuthorDate: Tue Dec 16 16:13:31 2025 +0545

    feat: standalone mode status api (#12810)
    
    Signed-off-by: Abhishek Choudhary <[email protected]>
---
 apisix/core/config_yaml.lua         |  4 +++
 t/cli/test_status_api_standalone.sh | 67 +++++++++++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+)

diff --git a/apisix/core/config_yaml.lua b/apisix/core/config_yaml.lua
index efad38b6f..d0443f256 100644
--- a/apisix/core/config_yaml.lua
+++ b/apisix/core/config_yaml.lua
@@ -567,6 +567,10 @@ function _M.init_worker()
     -- sync data in each non-master process
     ngx.timer.every(1, read_apisix_config)
 
+    if apisix_yaml then
+        update_config(apisix_yaml, apisix_yaml_mtime)
+    end
+
     return true
 end
 
diff --git a/t/cli/test_status_api_standalone.sh 
b/t/cli/test_status_api_standalone.sh
new file mode 100755
index 000000000..c513a1ab8
--- /dev/null
+++ b/t/cli/test_status_api_standalone.sh
@@ -0,0 +1,67 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+. ./t/cli/common.sh
+
+standalone() {
+    clean_up
+    git checkout conf/apisix.yaml
+}
+
+trap standalone EXIT
+
+# support environment variables
+echo '
+apisix:
+  enable_admin: false
+deployment:
+  role: data_plane
+  role_data_plane:
+    config_provider: yaml
+nginx_config:
+  error_log_level: warn
+apisix:
+  status:
+    ip: 127.0.0.1
+    port: 7085
+' > conf/config.yaml
+
+echo '
+routes:
+  -
+    uri: /get
+    upstream:
+      nodes:
+        "httpbin.local:8280": 1
+      type: roundrobin
+#END
+' > conf/apisix.yaml
+
+# check for resolve variables
+make run
+
+sleep 0.5
+
+curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:7085/status/ready | 
grep 200 \
+|| (echo "failed: status/ready api didn't return 200"; exit 1)
+
+sleep 0.5
+
+curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:7085/status | grep 200 
\
+|| (echo "failed: status api didn't return 200"; exit 1)

Reply via email to