Skip to content

Commit ee6f6db

Browse files
authored
fix: allow for large shared_size in kubernetes discovery (#12123)
1 parent 6950388 commit ee6f6db

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

apisix/discovery/kubernetes/schema.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ local default_weight_schema = {
101101

102102
local shared_size_schema = {
103103
type = "string",
104-
pattern = [[^[1-9][0-9]?m$]],
104+
pattern = [[^[1-9][0-9]*m$]],
105105
default = "1m",
106106
}
107107

t/kubernetes/discovery/kubernetes.t

+36
Original file line numberDiff line numberDiff line change
@@ -385,3 +385,39 @@ qr/re-read the token value/
385385
--- grep_error_log_out
386386
re-read the token value
387387
re-read the token value
388+
389+
390+
391+
=== TEST 8: default value with minimal configuration and large shared_size
392+
--- yaml_config
393+
apisix:
394+
node_listen: 1984
395+
config_center: yaml
396+
deployment:
397+
role: data_plane
398+
role_data_plane:
399+
config_provider: yaml
400+
discovery:
401+
kubernetes:
402+
client:
403+
token: ${KUBERNETES_CLIENT_TOKEN}
404+
shared_size: "1000m"
405+
--- request
406+
GET /compare
407+
{
408+
"service": {
409+
"schema": "https",
410+
"host": "${KUBERNETES_SERVICE_HOST}",
411+
"port": "${KUBERNETES_SERVICE_PORT}"
412+
},
413+
"client": {
414+
"token": "${KUBERNETES_CLIENT_TOKEN}"
415+
},
416+
"watch_endpoint_slices": false,
417+
"shared_size": "1000m",
418+
"default_weight": 50
419+
}
420+
--- more_headers
421+
Content-type: application/json
422+
--- response_body
423+
true

0 commit comments

Comments
 (0)