Skip to content

Commit

Permalink
chore: update route.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellmueller committed May 1, 2024
1 parent 8db0d7f commit a4304a8
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions chart/cas-cif/templates/route.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{{- $route := (lookup "route.openshift.io/v1" "Route" .Release.Namespace "cas-cif" ) }}
{{- $certificate := "" }}
{{- $key := "" }}
{{- $caCertificate := "" }}
{{- if $route }}
{{- $certificate = $route.spec.tls.certificate }}
{{- $key = $route.spec.tls.key }}
{{- $caCertificate = $route.spec.tls.caCertificate }}
{{- $keySecret := "Secret not found" }}
{{- $certSecret := "Secret not found" }}
{{- $CACertSecret := "Secret not found" }}

{{- $existingSSLSecret := (lookup "v1" "Secret" .Release.Namespace "ssl-cert-cas-cif" ) }}
{{- if $existingSSLSecret }}
{{- $keySecret = index $existingSSLSecret.data "private-key" | b64dec | quote}}
{{- $certSecret = index $existingSSLSecret.data "certificate" | b64dec | quote}}
{{- $CACertSecret = index $existingSSLSecret.data "CACert" | b64dec | quote}}
{{- end -}}

apiVersion: route.openshift.io/v1
Expand All @@ -20,13 +21,12 @@ spec:
port:
targetPort: {{ template "cas-cif.fullname" . }}
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
{{- if $certificate }}
certificate: {{ $certificate | quote }}
key: {{ $key | quote }}
caCertificate: {{ $caCertificate | quote }}
{{- end }}
termination: edge
{{- if hasSuffix "-prod" .Release.Namespace }}
key: {{ $keySecret }}
certificate: {{ $certSecret }}
caCertificate: {{ $CACertSecret }}
to:
kind: Service
name: {{ template "cas-cif.fullname" . }}
Expand Down

0 comments on commit a4304a8

Please sign in to comment.