From 7205b08f63298d85b118358c95da34f2bad41fa6 Mon Sep 17 00:00:00 2001 From: Raphael Ludwig Date: Fri, 15 Jul 2022 09:25:47 +0200 Subject: [PATCH] fix: Auto-detection of Keptn 0.17.0 Signed-off-by: Raphael Ludwig --- chart/templates/_helpers.tpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 2dca0885..360acda9 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -85,12 +85,15 @@ Create the name of the job service account to use Helper functions of the auto detection feature of Keptn */}} {{- define "job-executor-service.remote-control-plane.namespace" -}} + {{- if .Values.remoteControlPlane.autoDetect.namespace }} + {{- .Values.remoteControlPlane.autoDetect.namespace }} + {{- else }} {{- $detectedKeptnApiGateways := list }} {{- /* Find api-gateway-nginx service, which is used as keptn api gatway */ -}} {{- $services := lookup "v1" "Service" (.Values.remoteControlPlane.autoDetect.namespace | default "") "" }} {{- range $index, $srv := $services.items }} - {{- if and (eq "api-gateway-nginx" $srv.metadata.name ) (hasPrefix "keptn-" ( get $srv.metadata.labels "app.kubernetes.io/part-of" )) }} + {{- if and (eq "api-gateway-nginx" $srv.metadata.name ) (hasPrefix "keptn" ( get $srv.metadata.labels "app.kubernetes.io/part-of" )) }} {{- $detectedKeptnApiGateways = append $detectedKeptnApiGateways $srv }} {{- end }} {{- end }} @@ -103,6 +106,7 @@ Helper functions of the auto detection feature of Keptn {{- end }} {{- (index $detectedKeptnApiGateways 0).metadata.namespace }} + {{- end }} {{- end }} {{- define "job-executor-service.remote-control-plane.token" -}}