diff --git a/library/common/templates/class/_ingress_old.tpl b/library/common/templates/class/_ingress_old.tpl deleted file mode 100644 index a0f2d0bb..00000000 --- a/library/common/templates/class/_ingress_old.tpl +++ /dev/null @@ -1,69 +0,0 @@ -{{/* -This template serves as a blueprint for all Ingress objects that are created -within the common library. -*/}} -{{- define "tc.v1.common.class.ingress.old" -}} - {{- $fullName := include "tc.v1.common.lib.chart.names.fullname" . -}} - {{- $values := dict -}} - {{- $ingressName := "" -}} - - - {{/* Get the name of the primary service, if any */}} - {{- $primaryServiceName := (include "tc.v1.common.lib.util.service.primary" (dict "services" .Values.service "root" .)) -}} - {{/* Get service values of the primary service, if any */}} - {{- $primaryService := get .Values.service $primaryServiceName -}} - {{- $defaultServiceName := $fullName -}} - - {{- if and (hasKey $primaryService "nameOverride") $primaryService.nameOverride -}} - {{- $defaultServiceName = printf "%v-%v" $defaultServiceName $primaryService.nameOverride -}} - {{- end -}} - {{- $defaultServicePort := get $primaryService.ports (include "tc.v1.common.lib.util.service.ports.primary" (dict "svcValues" $primaryService "svcName" $primaryServiceName )) -}} - - ---- - -spec: - {{- if $values.certificateIssuer }} - tls: - {{- range $index, $hostsValues := $values.hosts }} - - hosts: - - {{ tpl $hostsValues.host $ | quote }} - secretName: {{ ( printf "%v-%v-%v" $ingressName "tls" $index ) }} - {{- end -}} - {{- else if $values.tls }} - tls: - {{- range $index, $tlsValues := $values.tls }} - {{- $tlsName := ( printf "%v-%v" "tls" $index ) }} - - hosts: - {{- range $tlsValues.hosts }} - - {{ tpl . $ | quote }} - {{- end -}} - {{- if $tlsValues.certificateIssuer }} - secretName: {{ printf "%v-%v" $ingressName $tlsName }} - {{- else if and ($tlsValues.scaleCert) ($.Values.global.ixChartContext) -}} - {{- $cert := dict }} - {{- $_ := set $cert "id" $tlsValues.scaleCert }} - {{- $_ := set $cert "nameOverride" $tlsName }} - secretName: {{ printf "%s-tls-%v" (include "tc.v1.common.lib.chart.names.fullname" $) $index }} - {{- else if .clusterCertificate }} - secretName: clusterissuer-templated-{{ tpl .clusterCertificate $ }} - {{- else if .secretName }} - secretName: {{ tpl .secretName $ | quote }} - {{- end -}} - {{- end -}} - {{- end }} - rules: - {{- range $values.hosts }} - paths: - {{- range .paths -}} - {{- $service := $defaultServiceName -}} - {{- $port := $defaultServicePort.port -}} - {{- if .service -}} - {{- $service = default $service .service.name -}} - {{- $port = default $port .service.port -}} - {{- end }} - {{- end -}} - {{- end -}} - - -{{- end -}} diff --git a/library/common/templates/spawner/_ingress-old.tpl b/library/common/templates/spawner/_ingress-old.tpl deleted file mode 100644 index 29a6fa88..00000000 --- a/library/common/templates/spawner/_ingress-old.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* Renders the Ingress objects required by the chart */}} -{{- define "tc.v1.common.spawner.ingress.old" -}} - {{- $fullname := include "tc.v1.common.lib.chart.names.fullname" $ -}} - - {{/* Generate named ingresses as required */}} - {{- range $name, $ingress := .Values.ingress -}} - {{- if $ingress.enabled -}} - {{- $ingressValues := $ingress -}} - {{- $ingressName := $fullname -}} - - {{/* set defaults */}} - {{- if and (not $ingressValues.nameOverride) (ne $name (include "tc.v1.common.lib.util.ingress.primary" $)) -}} - {{- $_ := set $ingressValues "nameOverride" $name -}} - {{- end -}} - - {{- if $ingressValues.nameOverride -}} - {{- $ingressName = printf "%v-%v" $ingressName $ingressValues.nameOverride -}} - {{- end -}} - - {{- $_ := set $ingressValues "name" $ingressName -}} - - {{- $_ := set $ "ObjectValues" (dict "ingress" $ingressValues) -}} - {{- include "tc.v1.common.class.ingress" $ -}} - {{- if and ( $ingressValues.tls ) ( not $ingressValues.clusterIssuer ) -}} - {{- range $index, $tlsValues := $ingressValues.tls -}} - {{- $tlsName := ( printf "%v-%v" "tls" $index ) -}} - {{- if $tlsValues.certificateIssuer -}} - {{- include "tc.v1.common.class.certificate" (dict "root" $ "name" ( printf "%v-%v" $ingressName $tlsName ) "certificateIssuer" $tlsValues.certificateIssuer "hosts" $tlsValues.hosts ) -}} - {{- else if and ( $tlsValues.scaleCert ) ( $.Values.global.ixChartContext ) -}} - - {{/* Create certificate object and use it to construct a secret */}} - {{- $objectData := dict -}} - {{- $_ := set $objectData "id" .scaleCert -}} - - {{- $objectName := (printf "%s-%s" $fullname $tlsName) -}} - {{/* Perform validations */}} - {{- include "tc.v1.common.lib.chart.names.validation" (dict "name" $objectName) -}} - {{- include "tc.v1.common.lib.scaleCertificate.validation" (dict "objectData" $objectData) -}} - {{- include "tc.v1.common.lib.metadata.validation" (dict "objectData" $objectData "caller" "Certificate") -}} - - {{/* Prepare data */}} - {{- $data := fromJson (include "tc.v1.common.lib.scaleCertificate.getData" (dict "rootCtx" $ "objectData" $objectData)) -}} - {{- $_ := set $objectData "data" $data -}} - - {{/* Set the type to certificate */}} - {{- $_ := set $objectData "type" "certificate" -}} - - {{/* Set the name of the certificate */}} - {{- $_ := set $objectData "name" $objectName -}} - {{- $_ := set $objectData "shortName" $name -}} - - {{/* Call class to create the object */}} - {{- include "tc.v1.common.class.secret" (dict "rootCtx" $ "objectData" $objectData) -}} - - {{- end -}} - {{- end -}} - {{- end -}} - {{- else if $ingress.required -}} - {{- fail (printf "Ingress - [ingress.%s] is set to be [required] and cannot be disabled" $name) -}} - {{- end -}} - {{- end -}} -{{- end -}}