From 5cfee9769cc5a995ac7adf06eb145b28cf84f8c6 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Thu, 9 Oct 2025 10:51:22 +0300 Subject: [PATCH 1/2] fix: app-proxy cors --- .../_components/cap-app-proxy/_config.yaml | 2 +- .../tests/app-proxy-misc_test.yaml | 24 +++++++++++++++++++ charts/gitops-runtime/values.yaml | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) 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..11be4120 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 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 4b24c8e6..41d9e316 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -541,7 +541,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: From 2ad192691db57bbc312b54d1c5f60ee8156781b1 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Thu, 9 Oct 2025 10:56:08 +0300 Subject: [PATCH 2/2] fix: app-proxy cors --- charts/gitops-runtime/tests/app-proxy-misc_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/gitops-runtime/tests/app-proxy-misc_test.yaml b/charts/gitops-runtime/tests/app-proxy-misc_test.yaml index 11be4120..76997268 100644 --- a/charts/gitops-runtime/tests/app-proxy-misc_test.yaml +++ b/charts/gitops-runtime/tests/app-proxy-misc_test.yaml @@ -308,7 +308,7 @@ tests: path: data.cors value: "https://local.codefresh.io" -- it: app-proxy configmap should have fallback cors from .Values.global.codefresh.url +- it: app-proxy configmap should have fallback to cors from .Values.global.codefresh.url template: 'app-proxy/config.yaml' values: - ./values/mandatory-values.yaml