penguin/flatgit

flatgit showcase

commit 748df2db506f433b5f56a298d27f616085da27aa

author斟酌 鵬兄 <tgckpg@gmail.com>
date2026-06-22T09:41:24Z
subjectconvert defaultBranch into default_branch for json
commit 748df2db506f433b5f56a298d27f616085da27aa
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2026-06-22T09:41:24Z

    convert defaultBranch into default_branch for json
---
 resources/flatgit.chart/templates/configmap.yaml | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/resources/flatgit.chart/templates/configmap.yaml b/resources/flatgit.chart/templates/configmap.yaml
index 4b8e16c..686c46b 100644
--- a/resources/flatgit.chart/templates/configmap.yaml
+++ b/resources/flatgit.chart/templates/configmap.yaml
@@ -6,6 +6,17 @@ metadata:
     {{- include "flatgit.labels" . | nindent 4 }}
 data:
   config.json: |
+    {{- $repos := list -}}
+    {{- range .Values.flatgit.repos }}
+    {{- $repo := dict
+      "name" .name
+      "owner" .owner
+      "description" .description
+      "url" .url
+      "default_branch" .defaultBranch
+    -}}
+    {{- $repos = append $repos $repo -}}
+    {{- end }}
     {
       "addr": {{ .Values.flatgit.addr | quote }},
       "data_dir": {{ .Values.flatgit.dataDir | quote }},
@@ -22,5 +33,5 @@ data:
         "workers": {{ .Values.flatgit.render.workers }},
         "max_commits": {{ .Values.flatgit.render.maxCommits }}
       },
-      "repos": {{ .Values.flatgit.repos | toJson }}
-    }
\ No newline at end of file
+      "repos": {{ $repos | toJson }}
+    }