diff --git a/charts/gitops-runtime/templates/_components/cap-app-proxy/_config.yaml b/charts/gitops-runtime/templates/_components/cap-app-proxy/_config.yaml index 172d4f9f..aa185052 100644 --- a/charts/gitops-runtime/templates/_components/cap-app-proxy/_config.yaml +++ b/charts/gitops-runtime/templates/_components/cap-app-proxy/_config.yaml @@ -1,7 +1,7 @@ {{- define "cap-app-proxy.resources.configmap-documented-configs" }} argoWorkflowsInsecure: {{ .Values.config.argoWorkflowsInsecure | quote }} clusterChunkSize: {{ .Values.config.clusterChunkSize | quote }} -cors: {{ .Values.global.codefresh.url }} +cors: {{ .Values.config.cors | default .Values.global.codefresh.url }} isConfigurationRuntime: {{ .Values.global.runtime.isConfigurationRuntime | quote }} isExternalArgoCD: {{ .Values.global.runtime.isExternalArgoCD | quote }} runtimeName: {{ required "global.runtime.name is required" .Values.global.runtime.name | quote}} diff --git a/charts/gitops-runtime/tests/app-proxy-misc_test.yaml b/charts/gitops-runtime/tests/app-proxy-misc_test.yaml index d01317bf..76997268 100644 --- a/charts/gitops-runtime/tests/app-proxy-misc_test.yaml +++ b/charts/gitops-runtime/tests/app-proxy-misc_test.yaml @@ -295,3 +295,27 @@ tests: - equal: path: spec.template.spec.containers[0].name value: cap-app-proxy + +- it: app-proxy configmap should have cors from .Values.app-proxy.config.cors + template: 'app-proxy/config.yaml' + values: + - ./values/mandatory-values.yaml + set: + global.codefresh.url: "https://g.codefresh.io" + app-proxy.config.cors: "https://local.codefresh.io" + asserts: + - equal: + path: data.cors + value: "https://local.codefresh.io" + +- it: app-proxy configmap should have fallback to cors from .Values.global.codefresh.url + template: 'app-proxy/config.yaml' + values: + - ./values/mandatory-values.yaml + set: + global.codefresh.url: "https://g.codefresh.io" + app-proxy.config.cors: null + asserts: + - equal: + path: data.cors + value: "https://g.codefresh.io" diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 030922a2..0b30013a 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -536,7 +536,7 @@ app-proxy: # - reduce this value if you have a lot of clusters and the cron job is failing with payload too large error # - use 0 to sync all clusters at once clusterChunkSize: 50 - # -- Cors settings for app-proxy. This is the list of allowed domains for platform. + # -- Cors settings for app-proxy. This is the list of allowed domains for platform (comma separated). cors: "https://g.codefresh.io" env: {} serviceAccount: