fix and test clusterCertificate

This commit is contained in:
Stavros kois
2023-12-08 02:31:02 +02:00
parent 205e4ca335
commit 7adac14ee4
2 changed files with 53 additions and 7 deletions

View File

@@ -148,7 +148,7 @@ tests:
- some-other-test-host
secretName: test-release-name-common-test-scale-tls-1
- it: should pass with ingress created with tls with certificateIssuer
- it: should pass with ingress created with clusterCertificate
set:
operator: *operator
service: *service
@@ -167,10 +167,10 @@ tests:
- hosts:
- test-host
- other-test-host
certificateIssuer: some-issuer
clusterCertificate: some-cert
- hosts:
- some-other-test-host
certificateIssuer: some-other-issuer
clusterCertificate: some-other-cert
integrations: &integrations
traefik:
enabled: false
@@ -189,7 +189,53 @@ tests:
- hosts:
- test-host
- other-test-host
secretName: test-release-name-common-test-tls-0
secretName: certificate-issuer-some-cert
- hosts:
- some-other-test-host
secretName: test-release-name-common-test-tls-1
secretName: certificate-issuer-some-other-cert
# - it: should pass with ingress created with tls with certificateIssuer
# set:
# operator: *operator
# service: *service
# ingress:
# my-ingress:
# enabled: true
# primary: true
# hosts:
# - host: test-host
# paths:
# - path: /test-path
# - host: other-test-host
# paths:
# - path: /other-test-path
# tls:
# - hosts:
# - test-host
# - other-test-host
# certificateIssuer: some-issuer
# - hosts:
# - some-other-test-host
# certificateIssuer: some-other-issuer
# integrations: &integrations
# traefik:
# enabled: false
# asserts:
# - documentIndex: &ingressDoc 1
# isKind:
# of: Ingress
# - documentIndex: *ingressDoc
# equal:
# path: metadata.name
# value: test-release-name-common-test
# - documentIndex: *ingressDoc
# equal:
# path: spec.tls
# value:
# - hosts:
# - test-host
# - other-test-host
# secretName: test-release-name-common-test-tls-0
# - hosts:
# - some-other-test-host
# secretName: test-release-name-common-test-tls-1

View File

@@ -78,10 +78,10 @@ spec:
{{- $secretName = tpl $t.secretName $rootCtx -}}
{{- else if $t.scaleCert -}}
{{- $secretName = printf "%s-scale-tls-%d" $objectData.name ($idx | int) -}}
{{- else if $t.certificateIssuer -}}
{{- else if $t.certificateIssuer -}} {{/* TODO: UT */}}
{{- $secretName = printf "%s-tls-%d" $objectData.name ($idx | int) -}}
{{- else if $t.clusterCertificate -}}
{{/* TODO: Needs the refactor of Certificate object */}}
{{- $secretName = printf "certificate-issuer-%s" (tpl $t.clusterCertificate $rootCtx) -}}
{{- end }}
- secretName: {{ $secretName }}
hosts: