From 6a62c795c870d99dce291b2bfde04953b5c7e215 Mon Sep 17 00:00:00 2001 From: John Hsu Date: Fri, 3 May 2024 00:22:54 -0700 Subject: [PATCH] EDIT webwork support for saml2 conf file Added another file for the configmap, previously we only had localOverrides.conf. I renamed the "localOverrides.conf" key to "localOverrides" as the dot was causing troubles, couldn't figure out how to escape the dot and this was the simpler solution. There is now a 'authen_saml2' file under .Values.webworkFiles, this is a YAML file and needs to be mounted in Webwork's conf/authen_saml2.yml in order to enable the SAML2 plugin. Helm lint wasn't happy with the "if .Values.webworkFiles.localOverrides" check, complaining about nil pointer. Found people saying that if you wrap (.Values.webworkFiles) in parens, it stops complaining. --- webwork/Chart.yaml | 2 +- webwork/templates/_helpers.tpl | 20 ++++++++++++++++++-- webwork/templates/cm.yaml | 5 ++++- webwork/values.yaml | 3 ++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/webwork/Chart.yaml b/webwork/Chart.yaml index a7fdb84..1ef1365 100644 --- a/webwork/Chart.yaml +++ b/webwork/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.9 +version: 0.1.10 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/webwork/templates/_helpers.tpl b/webwork/templates/_helpers.tpl index f006a09..3c03ae9 100644 --- a/webwork/templates/_helpers.tpl +++ b/webwork/templates/_helpers.tpl @@ -206,11 +206,16 @@ volumeMounts: mountPath: /opt/webwork/webwork2/htdocs/DATA - name: webwork-logs-data mountPath: /opt/webwork/webwork2/logs - {{- if .Values.webworkFiles }} + {{- if (.Values.webworkFiles).localOverrides }} - name: localoverrides-config mountPath: /opt/webwork/webwork2/conf/localOverrides.conf subPath: localOverrides.conf {{- end }} + {{- if (.Values.webworkFiles).authen_saml2 }} +- name: authen-saml2-config + mountPath: /opt/webwork/webwork2/conf/authen_saml2.yml + subPath: authen_saml2.yml + {{- end }} {{- end }} @@ -251,10 +256,21 @@ volumeMounts: {{- else }} emptyDir: {} {{- end }} -{{- if .Values.webworkFiles }} +{{- if (.Values.webworkFiles).localOverrides }} - name: localoverrides-config configMap: name: {{ template "webwork.fullname" . }} + items: + - key: localOverrides + path: localOverrides.conf +{{- end }} +{{- if (.Values.webworkFiles).authen_saml2 }} +- name: authen-saml2-config + configMap: + name: {{ template "webwork.fullname" . }} + items: + - key: authen_saml2 + path: authen_saml2.yml {{- end }} {{- end }} diff --git a/webwork/templates/cm.yaml b/webwork/templates/cm.yaml index ecc6eaa..7240323 100644 --- a/webwork/templates/cm.yaml +++ b/webwork/templates/cm.yaml @@ -6,7 +6,10 @@ metadata: labels: {{- include "webwork.labels" . | nindent 4 }} data: - {{ toYaml .Values.webworkFiles | indent 2 }} + localOverrides: + {{ toYaml (.Values.webworkFiles).localOverrides | indent 2 }} + authen_saml2: + {{ toYaml (.Values.webworkFiles).authen_saml2 | indent 2 }} {{- end}} {{- if .Values.shibd.idp.attribute_map }} diff --git a/webwork/values.yaml b/webwork/values.yaml index d52e3ce..e07ee2d 100644 --- a/webwork/values.yaml +++ b/webwork/values.yaml @@ -317,7 +317,8 @@ shibd: # TODO: Add vars to deployment # webworkFiles: -# localOverride.conf: | +# localOverride: | +# authen_saml2: | # caliper TODO: Add to deployment caliper: