Skip to content

fix(apisix): quote IP values in configmap so IPv6 addresses do not break YAML#963

Open
SAY-5 wants to merge 1 commit intoapache:masterfrom
SAY-5:fix/quote-configmap-ipv6
Open

fix(apisix): quote IP values in configmap so IPv6 addresses do not break YAML#963
SAY-5 wants to merge 1 commit intoapache:masterfrom
SAY-5:fix/quote-configmap-ipv6

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 17, 2026

Problem

charts/apisix/templates/configmap.yaml renders ip: values and allow_admin
list items without quoting. For IPv4 this is fine, but when the value contains
YAML-flow characters the rendered file becomes invalid YAML:

# e.g. apisix.admin.ip = "[::]"
admin_listen:
  ip: [::]                     # parses as an empty flow sequence, not a string

# e.g. allow_admin contains "::/0"
allow_admin:
  - ::/0                       # treated as a mapping-style token, not a string

apisix then fails to start, or picks up a different value than the operator
supplied. This is the failure mode reported in #920.

Fix

Pipe the affected templated values through the quote filter so IPv6 values
render as regular YAML strings regardless of format (::, [::], ::/0,
fe80::/10, etc). Four locations in charts/apisix/templates/configmap.yaml:

  • admin.admin_listen.ip from .Values.apisix.admin.ip (called out in the issue)
  • admin.allow_admin list items from .Values.apisix.admin.allow.ipList (called out in the issue)
  • control.ip from .Values.control.service.ip (same bug, same chart)
  • status.ip from .Values.apisix.status.ip (same bug, same chart)

IPv4 values are unaffected because YAML treats a quoted "127.0.0.1" identically
to the bare form, and each affected key is already documented as a string on the
apisix side.

Fixes #920

…eak 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 apache#920

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConfigMap template fails to quote IPv6 addresses causing YAML parsing errors

2 participants