mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-06 11:11:23 -03:00
more ingress validation
This commit is contained in:
@@ -584,10 +584,10 @@ tests:
|
||||
- hosts:
|
||||
- test-host
|
||||
secretName: test-secret
|
||||
scaleCert: "1"
|
||||
clusterCertificate: some-cert
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Ingress - Expected only one of [scaleCert, secretName] to be set, but got [scaleCert, secretName]
|
||||
errorMessage: Ingress - Expected only one of [scaleCert, secretName, certificateIssuer, clusterCertificate] to be set, but got [secretName, clusterCertificate]
|
||||
|
||||
- it: should fail with scaleCert outside of SCALE
|
||||
set:
|
||||
@@ -604,4 +604,4 @@ tests:
|
||||
scaleCert: "1"
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Ingress - [tls.scalecert] can only be used in TrueNAS SCALE
|
||||
errorMessage: Ingress - [tls.scaleCert] can only be used in TrueNAS SCALE
|
||||
|
||||
@@ -96,6 +96,12 @@ objectData:
|
||||
{{- end -}}
|
||||
|
||||
{{- range $t := $objectData.tls -}}
|
||||
{{- if $t.scaleCert -}}
|
||||
{{- if not $rootCtx.Values.global.ixChartContext -}}
|
||||
{{- fail "Ingress - [tls.scaleCert] can only be used in TrueNAS SCALE" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not $t.hosts -}}
|
||||
{{- fail "Ingress - Expected non-empty [tls.hosts]" -}}
|
||||
{{- end -}}
|
||||
@@ -121,8 +127,7 @@ objectData:
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* TODO: Add the rest of the options?! */}}
|
||||
{{- $certOptions := (list "scaleCert" "secretName") -}}
|
||||
{{- $certOptions := (list "scaleCert" "secretName" "certificateIssuer" "clusterCertificate") -}}
|
||||
{{- $optsSet := list -}}
|
||||
{{- range $opt := $certOptions -}}
|
||||
{{- if (get $t $opt) -}}
|
||||
|
||||
Reference in New Issue
Block a user