From 21cfbf79dc8f67e7a5ff125c8b539591acceace8 Mon Sep 17 00:00:00 2001 From: Alan Bridgeman Date: Mon, 29 Dec 2025 07:22:27 -0600 Subject: [PATCH] Added additional OAuth variable + refactored so that OAuth variables are now in template function --- templates/_oauth.tpl | 33 +++++++++++++++++++++ templates/deployment.yaml | 29 ++---------------- templates/oauth-credentials-config-map.yaml | 1 + values.yaml | 1 + 4 files changed, 38 insertions(+), 26 deletions(-) create mode 100644 templates/_oauth.tpl diff --git a/templates/_oauth.tpl b/templates/_oauth.tpl new file mode 100644 index 0000000..0259d10 --- /dev/null +++ b/templates/_oauth.tpl @@ -0,0 +1,33 @@ +{{- define "oauth.envVars" -}} +# OAuth Implementation Stuff +- name: BASE_APP_URL + valueFrom: + configMapKeyRef: + name: {{ .Release.Name }}-oauth-credentials + key: base-app-url +- name: APP_ABBRV + valueFrom: + configMapKeyRef: + name: {{ .Release.Name }}-oauth-credentials + key: app-abbreviation +- name: APP_NAME + valueFrom: + configMapKeyRef: + name: {{ .Release.Name }}-oauth-credentials + key: app-name +- name: SERVICE_NAME + valueFrom: + configMapKeyRef: + name: {{ .Release.Name }}-oauth-credentials + key: service-name +- name: DEV_PORT + valueFrom: + configMapKeyRef: + name: {{ .Release.Name }}-oauth-credentials + key: dev-port +- name: APP_REG_CONTACT_EMAIL + valueFrom: + configMapKeyRef: + name: {{ .Release.Name }}-oauth-credentials + key: app-reg-contact-email +{{- end -}} \ No newline at end of file diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 57c7a68..df1e201 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -31,32 +31,9 @@ spec: value: "9010" - name: ACCOUNTS_SUBDOMAIN_PREFIX value: "account" - # OAuth Implementation Stuff - - name: BASE_APP_URL - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-oauth-credentials - key: base-app-url - - name: APP_ABBRV - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-oauth-credentials - key: app-abbreviation - - name: APP_NAME - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-oauth-credentials - key: app-name - - name: SERVICE_NAME - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-oauth-credentials - key: service-name - - name: DEV_PORT - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-oauth-credentials - key: dev-port + {{- /* This injects the YAML defined in the `_oauth.tpl` file */ -}} + {{- include "oauth.envVars" . | nindent 8 }} + {{- /* This injects the YAML defined from the `db_deploy`, `cache_deploy` and `nosql_deploy` subcharts */ -}} {{- include "db.envVars" . | nindent 8 }} {{- include "cache.envVars" . | nindent 8 }} {{- include "nosql.envVars" . | nindent 8 }} diff --git a/templates/oauth-credentials-config-map.yaml b/templates/oauth-credentials-config-map.yaml index a5bf56a..3387b90 100644 --- a/templates/oauth-credentials-config-map.yaml +++ b/templates/oauth-credentials-config-map.yaml @@ -10,3 +10,4 @@ data: app-name: {{ .Values.oauth.appName }} service-name: {{ .Values.oauth.serviceName }} dev-port: {{ .Values.oauth.devPort | quote }} + app-reg-contact-email: {{ .Values.oauth.appRegContactEmail | quote }} diff --git a/values.yaml b/values.yaml index 0ac3dd8..6b3995c 100644 --- a/values.yaml +++ b/values.yaml @@ -61,6 +61,7 @@ oauth: appName: "" serviceName: "" devPort: "" + appRegContactEmail: "" # Configuration for the relational database # See the [Database Deployment Helm Chart](https://git.bridgemanaccessible.ca/Bridgeman-Accessible/db-deploy-helm) for more information