File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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---
58apiVersion : v1
69kind : ConfigMap
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 }}
Original file line number Diff line number Diff line change 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---
67apiVersion : apps/v1
78kind : Deployment
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 }}
You can’t perform that action at this time.
0 commit comments