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

wenming 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 ee6f6db18 fix: allow for large shared_size in kubernetes discovery 
(#12123)
ee6f6db18 is described below

commit ee6f6db18fcbd453fc7d364a22942e3fd9c49d97
Author: Ashish Tiwari <[email protected]>
AuthorDate: Sat Apr 5 12:58:11 2025 +0530

    fix: allow for large shared_size in kubernetes discovery (#12123)
---
 apisix/discovery/kubernetes/schema.lua |  2 +-
 t/kubernetes/discovery/kubernetes.t    | 36 ++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/apisix/discovery/kubernetes/schema.lua 
b/apisix/discovery/kubernetes/schema.lua
index 18df2a3b7..e18d06fb0 100644
--- a/apisix/discovery/kubernetes/schema.lua
+++ b/apisix/discovery/kubernetes/schema.lua
@@ -101,7 +101,7 @@ local default_weight_schema = {
 
 local shared_size_schema = {
     type = "string",
-    pattern = [[^[1-9][0-9]?m$]],
+    pattern = [[^[1-9][0-9]*m$]],
     default = "1m",
 }
 
diff --git a/t/kubernetes/discovery/kubernetes.t 
b/t/kubernetes/discovery/kubernetes.t
index 5f51506a7..5eb82b7a4 100644
--- a/t/kubernetes/discovery/kubernetes.t
+++ b/t/kubernetes/discovery/kubernetes.t
@@ -385,3 +385,39 @@ qr/re-read the token value/
 --- grep_error_log_out
 re-read the token value
 re-read the token value
+
+
+
+=== TEST 8: default value with minimal configuration and large shared_size
+--- yaml_config
+apisix:
+  node_listen: 1984
+  config_center: yaml
+deployment:
+  role: data_plane
+  role_data_plane:
+    config_provider: yaml
+discovery:
+  kubernetes:
+    client:
+        token: ${KUBERNETES_CLIENT_TOKEN}
+    shared_size: "1000m"
+--- request
+GET /compare
+{
+  "service": {
+    "schema": "https",
+    "host": "${KUBERNETES_SERVICE_HOST}",
+    "port": "${KUBERNETES_SERVICE_PORT}"
+  },
+  "client": {
+    "token": "${KUBERNETES_CLIENT_TOKEN}"
+  },
+  "watch_endpoint_slices": false,
+  "shared_size": "1000m",
+  "default_weight": 50
+}
+--- more_headers
+Content-type: application/json
+--- response_body
+true

Reply via email to