Skip to content

Commit 0842032

Browse files
committed
fix: a simple runtime application ends up being out-of-sync
Refactor redis.server configuration in argo-gateway and event-reporter configmaps to conditionally include the redis server URL only if it exists. Update tests to check for the absence of redis.server instead of its value.
1 parent 35c6871 commit 0842032

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

charts/gitops-runtime/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Determine argocd redis url
291291
{{- else }}
292292
{{- printf "" }}
293293
{{- end }}
294-
{{- end}}
294+
{{- end }}
295295

296296
{{/*
297297
Determine argo worklofws server name

charts/gitops-runtime/templates/argo-gateway/configmap.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{{- define "argo-gateway.resources.configmap.defaults" }}
22
argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }}
33
repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }}
4-
redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }}
4+
{{- $redisServer := (include "codefresh-gitops-runtime.argocd.redis.url" .) }}
5+
{{- if $redisServer }}
6+
redis.server: {{ $redisServer }}
7+
{{- end }}
58
{{- end }}
69

710
{{- $defaultConfig := (include "argo-gateway.resources.configmap.defaults" . | fromYaml ) }}

charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/configmap.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{{- define "cluster-event-reporter.resources.configmap.defaults" }}
22
argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }}
3-
redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }}
43
repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }}
4+
{{- $redisServer := (include "codefresh-gitops-runtime.argocd.redis.url" .) }}
5+
{{- if $redisServer }}
6+
redis.server: {{ $redisServer }}
7+
{{- end }}
58
argo-gateway.server: http://argo-gateway
69
resource.threadiness: '100'
710
app.queue.size: '1000'

charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/configmap.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{{- define "runtime-event-reporter.resources.configmap.defaults"}}
22
argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }}
3-
redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }}
43
repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }}
4+
{{- $redisServer := (include "codefresh-gitops-runtime.argocd.redis.url" .) }}
5+
{{- if $redisServer }}
6+
redis.server: {{ $redisServer }}
7+
{{- end }}
58
argo-gateway.server: http://argo-gateway
69
resource.threadiness: '10'
710
app.queue.size: '1000'

charts/gitops-runtime/tests/argo-api-gateway_test.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ tests:
1212
- equal:
1313
path: data["argocd.server"]
1414
value: argo-cd-server:80
15-
- equal:
15+
- notExists:
1616
path: data["redis.server"]
17-
value: null
1817
- equal:
1918
path: data["repo.server"]
2019
value: argo-cd-repo-server:8081

charts/gitops-runtime/tests/event-reporters_test.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ tests:
3939
- equal:
4040
path: data["argocd.server"]
4141
value: argo-cd-server:80
42-
- equal:
42+
- notExists:
4343
path: data["redis.server"]
44-
value: null
4544
- equal:
4645
path: data["repo.server"]
4746
value: argo-cd-repo-server:8081

0 commit comments

Comments
 (0)