From a71f4dbef7bc4e8a937aea75b148fb171aeed00c Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Fri, 17 Apr 2026 12:58:53 -0700 Subject: [PATCH] fix(apisix): quote IP values in configmap so IPv6 addresses do not break YAML The ConfigMap template emits `ip:` lines and allow_admin entries without quoting the user-supplied value. For IPv4 this works, but values like `[::]`, `::/0`, or `[::1]` are parsed by YAML as flow sequences or bare colons, so the rendered config fails to load and apisix will not start. Pipe each templated IP through Helm's `quote` filter so IPv6 values round-trip correctly. Covers admin.ip and admin.allow.ipList (which the issue calls out) plus control.service.ip and apisix.status.ip, which have the same bug. Fixes #920 Signed-off-by: SAY-5 --- charts/apisix/templates/configmap.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/apisix/templates/configmap.yaml b/charts/apisix/templates/configmap.yaml index 61895271..18e3f0c7 100644 --- a/charts/apisix/templates/configmap.yaml +++ b/charts/apisix/templates/configmap.yaml @@ -62,7 +62,7 @@ data: enable_control: {{ .Values.control.enabled }} {{- if .Values.control.enabled }} control: - ip: {{ default "127.0.0.1" .Values.control.service.ip }} + ip: {{ default "127.0.0.1" .Values.control.service.ip | quote }} port: {{ default 9090 .Values.control.service.port }} {{- end }} @@ -172,7 +172,7 @@ data: {{- $useTraditionalYaml := and (eq .Values.apisix.deployment.role "traditional") (eq .Values.apisix.deployment.role_traditional.config_provider "yaml") }} {{- if $useTraditionalYaml }} status: - ip: {{ default "127.0.0.1" .Values.apisix.status.ip }} + ip: {{ default "127.0.0.1" .Values.apisix.status.ip | quote }} port: {{ default "7085" (.Values.apisix.status.port | toString) }} {{- end}} @@ -338,7 +338,7 @@ data: allow_admin: # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow {{- if .Values.apisix.admin.allow.ipList }} {{- range $ips := .Values.apisix.admin.allow.ipList }} - - {{ $ips }} + - {{ $ips | quote }} {{- end }} {{- else }} - 0.0.0.0/0 @@ -349,7 +349,7 @@ data: # - "::/64" {{- if .Values.apisix.admin.enabled }} admin_listen: - ip: {{ .Values.apisix.admin.ip }} + ip: {{ .Values.apisix.admin.ip | quote }} port: {{ .Values.apisix.admin.port }} {{- end }} # Default token when use API to call for Admin API.