diff --git a/chart/templates/sonarqube/values.yaml b/chart/templates/sonarqube/values.yaml index dfa1119c2c7bce01e46a2a53b297cf36406a2e28..7fd951f0bf3b4bf44ebea0fbdc26cedbdcdc418e 100644 --- a/chart/templates/sonarqube/values.yaml +++ b/chart/templates/sonarqube/values.yaml @@ -7,6 +7,9 @@ {{- $domainName := default .Values.domain .Values.hostname }} domain: {{ $domainName }} +# Define variables to help with conditionals later +{{- $istioInjection := (and (eq (dig "istio" "injection" "enabled" .Values.addons.sonarqube) "enabled") .Values.istio.enabled) }} + istio: enabled: {{ .Values.istio.enabled }} sonarqube: @@ -28,6 +31,11 @@ image: pullPolicy: {{ .Values.imagePullPolicy }} pullSecret: private-registry +{{- if $istioInjection }} +annotations: + {{ include "istioAnnotation" . }} +{{- end }} + {{- if .Values.addons.sonarqube.sso.enabled }} sonarProperties: sonar.auth.saml.enabled: {{ .Values.addons.sonarqube.sso.enabled }} @@ -58,6 +66,14 @@ postgresql: service: port: {{ .port }} {{- else }} + {{- if $istioInjection }} + master: + podAnnotations: + {{ include "istioAnnotation" $ }} + slave: + podAnnotations: + {{ include "istioAnnotation" $ }} + {{- end }} # Use internal database, defaults are fine enabled: true {{- end }}