feat(common): Release v4.1.2 (#430)

Signed-off-by: Dan Manners <daniel.a.manners@gmail.com>
Co-authored-by: Daniel Manners <daniel.a.manners@gmail.com>
This commit is contained in:
Bernd Schorgers 2025-06-23 15:47:18 +02:00
parent de383dc580
commit 42354af45b
No known key found for this signature in database
69 changed files with 1431 additions and 668 deletions

View file

@ -0,0 +1,32 @@
{{/*
Validate RoleBinding values
*/}}
{{- define "bjw-s.common.lib.rbac.rolebinding.validate" -}}
{{- $rootContext := .rootContext -}}
{{- $roleBindingValues := .object -}}
{{- $rules := $roleBindingValues.rules -}}
{{/* Verify permutations for RoleBinding subjects */}}
{{- if and (not (empty $roleBindingValues.subjects)) (not (empty $roleBindingValues.roleRef)) -}}
{{- $subjectTypes := list "User" "Group" "ServiceAccount" -}}
{{- $subjectTypeCount := 0 -}}
{{- range $roleBindingValues.subjects -}}
{{- if hasKey . "kind" -}}
{{- if dict $subjectTypes has .kind -}}
{{- $subjectTypeCount = add $subjectTypeCount 1 -}}
{{- else -}}
{{- fail (printf "Invalid subject kind '%s' in RoleBinding '%s'. Valid kinds are: %s" .kind $roleBindingValues.identifier (join ", " $subjectTypes)) -}}
{{- end -}}
{{- else -}}
{{- fail (printf "Subject kind is required in RoleBinding '%s'" $roleBindingValues.identifier) -}}
{{- end -}}
{{- end -}}
{{- if eq $subjectTypeCount 0 -}}
{{- fail (printf "At least one subject with a valid kind is required in RoleBinding '%s'" $roleBindingValues.identifier) -}}
{{- end -}}
{{- else -}}
{{- fail (printf "subjects and roleRef are required for RoleBinding with key \"%v\"" $roleBindingValues.identifier) -}}
{{- end -}}
{{- end -}}

View file

@ -9,6 +9,10 @@ Validate Route values
{{/* Verify automatic Service detection */}}
{{- if not (eq 1 (len $enabledServices)) -}}
{{- if empty $routeObject.rules -}}
{{- fail (printf "An explicit rule is required because automatic Service detection is not possible. (route: %s)" $routeObject.identifier) -}}
{{- end -}}
{{- range $routeObject.rules -}}
{{- $rule := . -}}
{{- range $rule.backendRefs }}
@ -27,7 +31,6 @@ Validate Route values
{{- end }}
{{/* Route Rules */}}
{{- range $routeObject.rules }}
{{- if and (.filters) (.backendRefs) }}
{{- range .filters }}