From 56914c94e1c78974377b928c2139b8787e530e13 Mon Sep 17 00:00:00 2001 From: James Elliott Date: Tue, 16 Feb 2021 16:37:06 +1100 Subject: [PATCH] fix(traefik): reference to incorrect middlewares --- charts/authelia/Chart.yaml | 2 +- charts/authelia/templates/NOTES.txt | 2 +- charts/authelia/templates/_helpers.tpl | 9 ++++++++- charts/authelia/templates/traefikCRD/ingressRoute.yaml | 2 +- charts/authelia/templates/traefikCRD/middlewares.yaml | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/charts/authelia/Chart.yaml b/charts/authelia/Chart.yaml index 31a20d4..869c60f 100644 --- a/charts/authelia/Chart.yaml +++ b/charts/authelia/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: authelia -version: 0.1.14 +version: 0.1.15 kubeVersion: ">= 1.13.0" description: Authelia is a Single Sign-On Multi-Factor portal for web apps type: application diff --git a/charts/authelia/templates/NOTES.txt b/charts/authelia/templates/NOTES.txt index 9db8e03..a0892d5 100644 --- a/charts/authelia/templates/NOTES.txt +++ b/charts/authelia/templates/NOTES.txt @@ -9,7 +9,7 @@ You should be able to access Authelia soon via https://{{ include "authelia.ingr You will also need to direct your ingress to use the following path for forward auth: {{ include "authelia.forwardAuthPath" (merge (dict "Namespace" .Release.Namespace) .) }}. {{- else if (include "authelia.enabled.ingress.traefik" .) }} -You have selected the Traefik CRD to deploy the ingress. You can apply the {{ include "authelia.ingress.traefikCRD.middleware.name.forwardAuth" . }} ({{ .Release.Namespace }} namespace) middleware to any Traefik ingress type in order to use Authelia auth with that ingress. +You have selected the Traefik CRD to deploy the ingress. You can apply the {{ include "authelia.ingress.traefikCRD.middleware.name.chainAuth" . }} ({{ .Release.Namespace }} namespace) middleware to any Traefik ingress type in order to use Authelia auth with that ingress. You should be able to access Authelia soon via https://{{ include "authelia.ingressHostWithPath" . }} if everything is configured correctly in your values and the DNS record points to the correct location. {{- else -}} diff --git a/charts/authelia/templates/_helpers.tpl b/charts/authelia/templates/_helpers.tpl index 84479c8..567f6a6 100644 --- a/charts/authelia/templates/_helpers.tpl +++ b/charts/authelia/templates/_helpers.tpl @@ -142,7 +142,7 @@ Returns true if duo secret is configured. {{/* Returns the name of the chain Middleware for forward auth which gets applied to other IngressRoutes. */}} -{{- define "authelia.ingress.traefikCRD.middleware.name.chain" -}} +{{- define "authelia.ingress.traefikCRD.middleware.name.chainAuth" -}} {{- if .Values.ingress.traefikCRD.middlewares.chains.auth.nameOverride -}} {{- .Values.ingress.traefikCRD.middlewares.chains.auth.nameOverride -}} {{- else -}} @@ -150,6 +150,13 @@ Returns the name of the chain Middleware for forward auth which gets applied to {{- end -}} {{- end -}} +{{/* +Returns the name of the chain Middleware for forward auth which gets applied to other IngressRoutes. +*/}} +{{- define "authelia.ingress.traefikCRD.middleware.name.chainIngress" -}} + {{- printf "chain-%s" (include "authelia.name" .) -}} +{{- end -}} + {{/* Special Annotations Generator for the Ingress kind. */}} diff --git a/charts/authelia/templates/traefikCRD/ingressRoute.yaml b/charts/authelia/templates/traefikCRD/ingressRoute.yaml index 9347f79..5f0a904 100644 --- a/charts/authelia/templates/traefikCRD/ingressRoute.yaml +++ b/charts/authelia/templates/traefikCRD/ingressRoute.yaml @@ -17,7 +17,7 @@ spec: match: {{ default (printf "Host(`%s`) && PathPrefix(`%s`)" (include "authelia.ingressHost" .) (include "authelia.path" .)) .Values.ingress.traefikCRD.matchOverride }} priority: {{ default 10 .Values.ingress.traefikCRD.priority }} middlewares: - - name: {{ include "authelia.ingress.traefikCRD.middleware.name.chain" . }} + - name: {{ include "authelia.ingress.traefikCRD.middleware.name.chainIngress" . }} namespace: {{ .Release.Namespace }} services: - kind: Service diff --git a/charts/authelia/templates/traefikCRD/middlewares.yaml b/charts/authelia/templates/traefikCRD/middlewares.yaml index 68d9739..ed454bc 100644 --- a/charts/authelia/templates/traefikCRD/middlewares.yaml +++ b/charts/authelia/templates/traefikCRD/middlewares.yaml @@ -35,7 +35,7 @@ spec: apiVersion: traefik.containo.us/v1alpha1 kind: Middleware metadata: - name: {{ include "authelia.ingress.traefikCRD.middleware.name.chain" . }} + name: {{ include "authelia.ingress.traefikCRD.middleware.name.chainAuth" . }} labels: {{ include "authelia.labels" . | nindent 4 }} {{- with $annotations := include "authelia.annotations" . }} annotations: {{ $annotations | nindent 4 }} @@ -55,7 +55,7 @@ spec: apiVersion: traefik.containo.us/v1alpha1 kind: Middleware metadata: - name: {{ include "authelia.name" . }} + name: {{ include "authelia.ingress.traefikCRD.middleware.name.chainIngress" . }} labels: {{- include "authelia.labels" . | nindent 4 }} {{- with $annotations := (include "authelia.annotations" .) }}