From 797ac6a450f386d2f80b3f942f19eeef301b9323 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Thu, 8 Oct 2020 15:28:58 +0200 Subject: [PATCH] Use app-config.development.yaml to provide configuration instead of local The app-config.yaml file that comes inside the docker image for the backend contains configuration for the key `scaffolder.azure`. This automatically enables the use of azure and it is not possible to set its values to dummy ones because it will fail when it tries to validate them. To avoid the backend throwing an exception for this, the charts are using the "development" mode (via setting NODE_ENV=development). This means that the app-config.development.yaml file that ships in the container woud have higher precedence than the app-config.local.yaml file that the charts tried to create before. For that reason, for now, they will override the development file. A better solution would be to ship the docker images with a minimal app-config.yaml or even without any config. And then have these charts provide said file. --- ...ocal.yaml.tpl => app-config.development.yaml.tpl} | 12 ++++++++---- contrib/chart/backstage/templates/_helpers.tpl | 2 +- .../backstage/templates/backstage-app-config.yaml | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) rename contrib/chart/backstage/files/{app-config.local.yaml.tpl => app-config.development.yaml.tpl} (97%) diff --git a/contrib/chart/backstage/files/app-config.local.yaml.tpl b/contrib/chart/backstage/files/app-config.development.yaml.tpl similarity index 97% rename from contrib/chart/backstage/files/app-config.local.yaml.tpl rename to contrib/chart/backstage/files/app-config.development.yaml.tpl index 646d438771..76d6499145 100644 --- a/contrib/chart/backstage/files/app-config.local.yaml.tpl +++ b/contrib/chart/backstage/files/app-config.development.yaml.tpl @@ -35,12 +35,16 @@ catalog: locations: [] {{- end }} -sentry: - organization: {{ .Values.appConfig.sentry.organization | quote }} +auth: + providers: + microsoft: null scaffolder: - azure: - baseUrl: https://dev.azure.com/some-org + azure: null + + +sentry: + organization: {{ .Values.appConfig.sentry.organization | quote }} techdocs: generators: diff --git a/contrib/chart/backstage/templates/_helpers.tpl b/contrib/chart/backstage/templates/_helpers.tpl index ec54c91d1b..5d49ba6975 100644 --- a/contrib/chart/backstage/templates/_helpers.tpl +++ b/contrib/chart/backstage/templates/_helpers.tpl @@ -282,5 +282,5 @@ Postgres password for lighthouse app-config file name */}} {{- define "backstage.appConfigFilename" -}} -{{- "app-config.local.yaml" -}} +{{- "app-config.development.yaml" -}} {{- end -}} diff --git a/contrib/chart/backstage/templates/backstage-app-config.yaml b/contrib/chart/backstage/templates/backstage-app-config.yaml index 987ad8e160..061fc3285b 100644 --- a/contrib/chart/backstage/templates/backstage-app-config.yaml +++ b/contrib/chart/backstage/templates/backstage-app-config.yaml @@ -4,7 +4,7 @@ metadata: name: {{ include "backstage.fullname" . }}-app-config data: {{ include "backstage.appConfigFilename" . | indent 2 }}: | -{{ tpl (.Files.Get "files/app-config.local.yaml.tpl") . | indent 4 }} +{{ tpl (.Files.Get "files/app-config.development.yaml.tpl") . | indent 4 }} --- apiVersion: v1 kind: ConfigMap