Skip to content

Commit 085cbb0

Browse files
fix(helm): apply per-agent presets in rendered config
1 parent 87510a5 commit 085cbb0

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

charts/openab/templates/configmap.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{{- range $name, $cfg := .Values.agents }}
22
{{- if ne (include "openab.agentEnabled" $cfg) "false" }}
33
{{- $d := dict "ctx" $ "agent" $name "cfg" $cfg }}
4+
{{- $command := include "openab.agentCommand" $d | trim }}
5+
{{- $args := include "openab.agentArgs" $d | trim }}
6+
{{- $workingDir := include "openab.agentWorkingDir" $d | trim }}
47
---
58
apiVersion: v1
69
kind: ConfigMap
@@ -26,9 +29,9 @@ data:
2629
allowed_users = {{ $cfg.discord.allowedUsers | default list | toJson }}
2730
2831
[agent]
29-
command = "{{ $cfg.command }}"
30-
args = {{ if $cfg.args }}{{ $cfg.args | toJson }}{{ else }}[]{{ end }}
31-
working_dir = "{{ $cfg.workingDir | default "/home/agent" }}"
32+
command = "{{ $command }}"
33+
args = {{ $args }}
34+
working_dir = "{{ $workingDir }}"
3235
{{- if $cfg.env }}
3336
env = { {{ range $k, $v := $cfg.env }}{{ $k }} = "{{ $v }}", {{ end }} }
3437
{{- end }}

charts/openab/templates/deployment.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{{- if ne (include "openab.agentEnabled" $cfg) "false" }}
33
{{- $d := dict "ctx" $ "agent" $name "cfg" $cfg }}
44
{{- $pvcEnabled := not (eq (include "openab.persistenceEnabled" $cfg) "false") }}
5+
{{- $workingDir := include "openab.agentWorkingDir" $d | trim }}
56
---
67
apiVersion: apps/v1
78
kind: Deployment
@@ -46,7 +47,7 @@ spec:
4647
key: discord-bot-token
4748
{{- end }}
4849
- name: HOME
49-
value: {{ $cfg.workingDir | default "/home/agent" }}
50+
value: {{ $workingDir | quote }}
5051
{{- range $k, $v := $cfg.env }}
5152
- name: {{ $k }}
5253
value: {{ $v | quote }}
@@ -65,11 +66,11 @@ spec:
6566
readOnly: true
6667
{{- if $pvcEnabled }}
6768
- name: data
68-
mountPath: {{ $cfg.workingDir | default "/home/agent" }}
69+
mountPath: {{ $workingDir | quote }}
6970
{{- end }}
7071
{{- if $cfg.agentsMd }}
7172
- name: config
72-
mountPath: {{ $cfg.workingDir | default "/home/agent" }}/AGENTS.md
73+
mountPath: {{ printf "%s/AGENTS.md" $workingDir | quote }}
7374
subPath: AGENTS.md
7475
{{- end }}
7576
{{- with $cfg.nodeSelector }}

0 commit comments

Comments
 (0)