Skip to content

Commit 3b85c47

Browse files
ashinsabu3Harness
authored andcommitted
feat: [CDS-107002]: allow for injecting configs directly into gitops agent configmap (#17)
* feat: [CDS-107002]: allow for injecting configs directly into gitops agent configmap
1 parent 97b34e8 commit 3b85c47

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

charts/templates/_common.tpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,19 @@ just set the value of .Values.harness.configMap.argocd.redisSvc
111111
{{- end -}}
112112
{{- end -}}
113113
{{- end -}}
114+
115+
116+
{{/*
117+
Renders a value that contains template.
118+
Usage:
119+
{{ include "harnesscommon.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
120+
*/}}
121+
{{- define "harnesscommon.tplvalues.render" -}}
122+
{{- if typeIs "string" .value }}
123+
{{- tpl .value .context }}
124+
{{- else }}
125+
{{- if .value }}
126+
{{- tpl (.value | toYaml) .context }}
127+
{{- end }}
128+
{{- end }}
129+
{{- end -}}

charts/templates/gitops-agent/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ data:
4242
GITOPS_AGENT_NUM_FETCHERS: "{{ .Values.agent.numFetchers }}"
4343
GITOPS_AGENT_NUM_PROCESSORS: "{{ .Values.agent.numProcessors }}"
4444
GITOPS_AGENT_NUM_RESPONDERS: "{{ .Values.agent.numResponders }}"
45+
{{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.agent.additionalConfig "context" $) | nindent 2}}
4546
kind: ConfigMap
4647
metadata:
4748
labels:

charts/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,11 @@ agent:
515515
# -- Number of task responders running concurrently for the gitops agent
516516
numResponders: 1
517517

518+
# -- Any additional env variables to be used by the gitops agent can be configured here
519+
additionalConfig:
520+
GITOPS_AGENT_MAPPING_TIMEOUT_SECONDS: "60"
521+
GITOPS_AGENT_ENABLE_RECONCILE_MEMORY_OPTIMIZATION: "true"
522+
GITOPS_AGENT_SELF_HEAL_SYNC_FILTER_OUT: "true"
518523
## Harness GitOps Agent upgrader
519524
upgrader:
520525
# -- Agent upgrader name

0 commit comments

Comments
 (0)