twellck opened a new issue, #920:
URL: https://github.com/apache/apisix-helm-chart/issues/920
## Description
When configuring APISIX to bind to IPv6 addresses using `[::]` in
values.yaml, the generated ConfigMap contains unquoted values which causes YAML
parsing errors in APISIX.
## Environment
- Helm Chart Version: 2.12.4
- Kubernetes Version: 1.34
- Helm Version: 3.18.4 (Through terraform's helm provider)
## Steps to Reproduce
1. Set in values.yaml:
```yaml
apisix:
admin:
ip: "[::]"
allow:
ipList:
- "::/0"
```
2. Deploy the chart: `helm install apisix apisix/apisix -f values.yaml`
3. Check APISIX pod logs or ConfigMap
4. Observe YAML parsing error
## Expected Behavior
IPv6 addresses should be properly quoted in the generated ConfigMap:
```yaml
ip: "[::]"
admin:
allow_admin:
- "::/0"
```
## Actual Behavior
ConfigMap contains unquoted values that fail YAML parsing:
```yaml
ip: [::] # Invalid YAML - interpreted as flow sequence
admin:
allow_admin:
- ::/0
```
## Root Cause
The ConfigMap template does not force quotation of IP addresses in listeners
or the admin allow list. YAML interprets `[` as the start of a flow sequence,
making `[::]` invalid syntax without quotes.
Examples from the template:
```yaml
ip: {{ .Values.apisix.admin.ip }}
```
```yaml
{{- range $ips := .Values.apisix.admin.allow.ipList }}
- {{ $ips }}
{{- end }}
```
## Current Workaround
Manually add escaped quotes in values.yaml:
```yaml
apisix:
admin:
ip: "\"[::]\""
allow:
ipList:
- "\"::/0\""
```
Or use the `--set-string` flag:
```bash
helm install apisix apisix/apisix --set-string apisix.admin.ip='[::]'
```
## Proposed Solution
Wrap relevant configmap sections such as IP address template values with
quotes:
```yaml
ip: {{ .Values.apisix.admin.ip | quote }}
```
```yaml
{{- range $ips := .Values.apisix.admin.allow.ipList }}
- {{ $ips | quote }}
{{- end }}
```
---
**I'm happy to submit a PR for this fix if helpful. This may be combined
with my other issue which also touches the ConfigMap template file.**
---
*Note: AI helped format this issue. The issue identification and proposed
solutions are my own work.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]