Skip to content

Commit

Permalink
fix(authelia): prevent traefik auto annotations overriding custom ones (
Browse files Browse the repository at this point in the history
#123)

Ensures that custom annotations on the ingress completely replace any automatic ones. However it's recommended that you utilize the entryPoints and middlewares options instead.
  • Loading branch information
james-d-elliott authored Jan 17, 2022
1 parent b83758e commit 000ab11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/authelia/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: authelia
version: 0.7.9
version: 0.7.10
kubeVersion: ">= 1.13.0-0"
description: Authelia is a Single Sign-On Multi-Factor portal for web apps
type: application
Expand Down
6 changes: 4 additions & 2 deletions charts/authelia/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,12 @@ Special Annotations Generator for the Ingress kind.
{{- $annotations = set $annotations "kubernetes.io/tls-acme" "true" -}}
{{- end -}}
{{- if and .Values.ingress.traefikCRD .Values.ingress.traefikCRD.disableIngressRoute -}}
{{- if .Values.ingress.traefikCRD.entryPoints -}}
{{- $annotations = set $annotations "traefik.ingress.kubernetes.io/router.entrypoints" (.Values.ingress.traefikCRD.entryPoints | join ",") -}}
{{- if and (gt (len .Values.ingress.traefikCRD.entryPoints) 0) (not (hasKey $annotations "traefik.ingress.kubernetes.io/router.entryPoints")) -}}
{{- $annotations = set $annotations "traefik.ingress.kubernetes.io/router.entryPoints" (.Values.ingress.traefikCRD.entryPoints | join ",") -}}
{{- end -}}
{{- if not (hasKey $annotations "traefik.ingress.kubernetes.io/router.middlewares") }}
{{- $annotations = set $annotations "traefik.ingress.kubernetes.io/router.middlewares" (printf "%s-%s@kubernetescrd" .Release.Namespace (include "authelia.ingress.traefikCRD.middleware.name.chainIngress" .)) -}}
{{- end }}
{{- end -}}
{{ include "authelia.annotations" (merge (dict "Annotations" $annotations) .) }}
{{- end -}}
Expand Down

0 comments on commit 000ab11

Please sign in to comment.