Skip to content
Snippets Groups Projects
Commit c45d9126 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4884-change bezeichner max. length to 46 and add helm unittest

parent fb1183b1
Branches
Tags
No related merge requests found
......@@ -63,10 +63,10 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- define "app.ozgcloudBezeichner" -}}
{{ $length := len (.Values.ozgcloud).bezeichner }}
{{- if ge 27 $length -}}
{{- if ge 46 $length -}}
{{ (.Values.ozgcloud).bezeichner }}
{{- else -}}
{{ required (printf "Bezichner %s ist zu lang (max. 27 Zeichen)" (.Values.ozgcloud).bezeichner) nil }}
{{ required (printf "Bezeichner %s ist zu lang (max. 46 Zeichen)" (.Values.ozgcloud).bezeichner) nil }}
{{- end -}}
{{- end -}}
......
suite: test ozgcloud bezeichner length
release:
name: eingang-manager
namespace: sh-helm-test
templates:
- templates/ingress.yaml
tests:
- it: should fail on bezeichner (in ingress host) length longer than 46 characters
template: ingress.yaml
set:
ozgcloud:
bezeichner: test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890
environment: test
bundesland: by
asserts:
- failedTemplate:
errorMessage: Bezeichner test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 ist zu lang (max. 46 Zeichen)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment