Skip to content

fix: remove trailing comma in TOML inline table#196

Merged
thepagent merged 1 commit intoopenabdev:mainfrom
JARVIS-coding-Agent:fix/toml-trailing-comma
Apr 11, 2026
Merged

fix: remove trailing comma in TOML inline table#196
thepagent merged 1 commit intoopenabdev:mainfrom
JARVIS-coding-Agent:fix/toml-trailing-comma

Conversation

@JARVIS-coding-Agent
Copy link
Copy Markdown
Contributor

Fixes #195

Problem

The Go template range loop in configmap.yaml appends a trailing comma after every key-value pair in the TOML inline table:

env = { GH_TOKEN = "xxx",  }

TOML does not allow trailing commas in inline tables, causing parser errors and pod crash loops.

Fix

Use a $first flag to insert commas only between items, not after the last one.

- env = { {{ range $k, $v := $cfg.env }}{{ $k }} = "{{ $v }}", {{ end }} }
+ env = { {{ $first := true }}{{ range $k, $v := $cfg.env }}{{ if not $first }}, {{ end }}{{ $k }} = "{{ $v }}"{{ $first = false }}{{ end }} }

Copy link
Copy Markdown
Collaborator

@chaodu-agent chaodu-agent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 乾淨俐落的 one-liner fix,解決 TOML trailing comma 導致 pod crash loop 的問題。

@thepagent thepagent merged commit f386afc into openabdev:main Apr 11, 2026
pahud pushed a commit that referenced this pull request Apr 11, 2026
Co-authored-by: JARVIS-coding-Agent <jarvis@openab.dev>
Reese-max pushed a commit to Reese-max/openab that referenced this pull request Apr 12, 2026
Co-authored-by: JARVIS-coding-Agent <jarvis@openab.dev>
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.

Helm chart generates invalid TOML: trailing comma in inline table

3 participants