refactor: switch config format from YAML to TOML

- Replace gopkg.in/yaml.v3 with github.com/BurntSushi/toml
- Update struct tags from yaml to toml
- Update config tests to use TOML syntax
- Add testdata/config.toml, update Helm configmap template
This commit is contained in:
2026-08-10 17:19:09 +08:00
parent 4e467e1136
commit 321d78a017
7 changed files with 129 additions and 67 deletions
+23 -19
View File
@@ -3,22 +3,26 @@ kind: ConfigMap
metadata:
name: {{ .Release.Name }}-config
data:
config.yaml: |
server:
addr: ":8080"
git:
type: gitea
base_url: "{{ .Values.git.baseUrl }}"
token: "${GIT_TOKEN}"
cluster:
kubeconfig: /etc/proto-gen/kubeconfig
namespace: {{ .Values.cluster.namespace }}
job_timeout: {{ .Values.cluster.jobTimeout }}
max_concurrent: {{ .Values.cluster.maxConcurrent }}
toolchain_registry: "{{ .Values.toolchainRegistry }}"
target_repo_template: "{{ .Values.targetRepoTemplate }}"
plugins:
{{- range .Values.plugins }}
- language: {{ .language }}
image: "{{ .image }}"
{{- end }}
config.toml: |
[server]
addr = ":8080"
[git]
type = "gitea"
base_url = "{{ .Values.git.baseUrl }}"
token = "${GIT_TOKEN}"
[cluster]
kubeconfig = "/etc/proto-gen/kubeconfig"
namespace = "{{ .Values.cluster.namespace }}"
job_timeout = {{ .Values.cluster.jobTimeout }}
max_concurrent = {{ .Values.cluster.maxConcurrent }}
toolchain_registry = "{{ .Values.toolchainRegistry }}"
target_repo_template = "{{ .Values.targetRepoTemplate }}"
{{- range .Values.plugins }}
[[plugins]]
language = "{{ .language }}"
image = "{{ .image }}"
{{- end }}