feat(traefik): Add stripPrefixRegex (#2422)

* feat(traefic): Add stripPrefixRegex

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>

* Update charts/core/traefik/templates/middlewares/stripPrefixRegex.yaml

* feat(traefik): Add stripPrefixRegex: Part 2

> I'm missing the required minor version bump in Chart.yaml and the definition + comments in values.yaml

Additionally, add the changelog entry to-be

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>

* feat(traefik): Add stripPrefixRegex: Oops

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>

Co-authored-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
This commit is contained in:
Stavros Ntentos
2022-04-04 22:48:33 +03:00
committed by GitHub
parent cef8425fa0
commit 5ac0465496
4 changed files with 44 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ sources:
- https://github.com/traefik/traefik-helm-chart
- https://traefik.io/
type: application
version: 11.0.13
version: 11.1.0
annotations:
truecharts.org/catagories: |
- network

View File

@@ -469,6 +469,29 @@ questions:
type: boolean
required: true
default: false
- variable: stripPrefixRegex
label: "stripPrefixRegex"
schema:
type: list
default: []
items:
- variable: stripPrefixRegexEntry
label: ""
schema:
additional_attrs: true
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
required: true
- variable: regex
label: "Regex"
schema:
type: string
required: true
default: ""
- variable: ipWhiteList
label: "ipWhiteList"

View File

@@ -0,0 +1,17 @@
{{- $values := .Values }}
{{- $namespace := ( printf "ix-%s" .Release.Name ) }}
{{- if or ( not .Values.ingressClass.enabled ) ( and ( .Values.ingressClass.enabled ) ( .Values.ingressClass.isDefaultClass ) ) }}
{{- $namespace = "default" }}
{{- end }}
{{ range $index, $middlewareData := .Values.middlewares.stripPrefixRegex }}
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: {{ $middlewareData.name }}
namespace: {{ $namespace }}
spec:
stripPrefixRegex:
regex: {{ $middlewareData.regex | quote }}
{{ end }}

View File

@@ -305,6 +305,9 @@ middlewares:
# regex: putregexhere
# replacement: replacementurlhere
# permanent: false
stripPrefixRegex: []
# - name: stripPrefixRegexName
# regex: putregexhere
ipWhiteList: []
# - name: ipWhiteListName
# sourceRange: []