Skip to content

Commit fafc1a4

Browse files
fix: app-proxy cors (codefresh-io#790)
1 parent d580ddb commit fafc1a4

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

charts/gitops-runtime/templates/_components/cap-app-proxy/_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{- define "cap-app-proxy.resources.configmap-documented-configs" }}
22
argoWorkflowsInsecure: {{ .Values.config.argoWorkflowsInsecure | quote }}
33
clusterChunkSize: {{ .Values.config.clusterChunkSize | quote }}
4-
cors: {{ .Values.global.codefresh.url }}
4+
cors: {{ .Values.config.cors | default .Values.global.codefresh.url }}
55
isConfigurationRuntime: {{ .Values.global.runtime.isConfigurationRuntime | quote }}
66
isExternalArgoCD: {{ .Values.global.runtime.isExternalArgoCD | quote }}
77
runtimeName: {{ required "global.runtime.name is required" .Values.global.runtime.name | quote}}

charts/gitops-runtime/tests/app-proxy-misc_test.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,27 @@ tests:
295295
- equal:
296296
path: spec.template.spec.containers[0].name
297297
value: cap-app-proxy
298+
299+
- it: app-proxy configmap should have cors from .Values.app-proxy.config.cors
300+
template: 'app-proxy/config.yaml'
301+
values:
302+
- ./values/mandatory-values.yaml
303+
set:
304+
global.codefresh.url: "https://g.codefresh.io"
305+
app-proxy.config.cors: "https://local.codefresh.io"
306+
asserts:
307+
- equal:
308+
path: data.cors
309+
value: "https://local.codefresh.io"
310+
311+
- it: app-proxy configmap should have fallback to cors from .Values.global.codefresh.url
312+
template: 'app-proxy/config.yaml'
313+
values:
314+
- ./values/mandatory-values.yaml
315+
set:
316+
global.codefresh.url: "https://g.codefresh.io"
317+
app-proxy.config.cors: null
318+
asserts:
319+
- equal:
320+
path: data.cors
321+
value: "https://g.codefresh.io"

charts/gitops-runtime/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ app-proxy:
536536
# - reduce this value if you have a lot of clusters and the cron job is failing with payload too large error
537537
# - use 0 to sync all clusters at once
538538
clusterChunkSize: 50
539-
# -- Cors settings for app-proxy. This is the list of allowed domains for platform.
539+
# -- Cors settings for app-proxy. This is the list of allowed domains for platform (comma separated).
540540
cors: "https://g.codefresh.io"
541541
env: {}
542542
serviceAccount:

0 commit comments

Comments
 (0)