Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
fix: Auto-detection of Keptn 0.17.0
Browse files Browse the repository at this point in the history
Signed-off-by: Raphael Ludwig <raphael.ludwig@dynatrace.com>
  • Loading branch information
Raffy23 committed Jul 15, 2022
1 parent 956422f commit 7205b08
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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" -}}
Expand Down

0 comments on commit 7205b08

Please sign in to comment.