apisix-helm-chart icon indicating copy to clipboard operation
apisix-helm-chart copied to clipboard

[ BUG ] error in configmap template - lua_shared_dict wrong list format

Open pietrogoddibit2win opened this issue 4 months ago • 0 comments

The issue is in https://github.com/apache/apisix-helm-chart/commit/ba02f571913d8b7e2e8fff5f3f3fe52bb67bed1b#diff-2e4fbf14d889534cc22104278b531a5717547dfd6b87ce1c7b25ea92c75bd794

The highlighted snippet is:

        lua_shared_dict:
        {{- range $dict := .Values.apisix.nginx.luaSharedDicts }}
          - {{ $dict.name }}: {{ $dict.size }}
        {{- end }}
  • YAML Structure Ambiguity: The snippet produces a list of strings in the format - key: value, which is interpreted in YAML as a list of strings, not as a map/object. This could lead to confusion, especially as lua_shared_dict usually expects a map of key-value pairs.

Concrete Recommendations

Use a Map Instead of a List for lua_shared_dict

If lua_shared_dict should be a map of dict names to sizes, it is clearer and more idiomatic to render it as a YAML map, not a list. For example:

lua_shared_dict:
  dict1: 10m
  dict2: 20m

Helm Template Fix:

lua_shared_dict:
{{- range $dict := .Values.apisix.nginx.luaSharedDicts }}
  {{ $dict.name }}: {{ $dict.size }}
{{- end }}

This approach renders a proper YAML map.

To fix it change the snippet from rendering a list of strings to a YAML map.

pietrogoddibit2win avatar Sep 14 '25 01:09 pietrogoddibit2win