From 91023e63fd1b8f52d770bf248e6aaa9c8f102c9e Mon Sep 17 00:00:00 2001
From: "kevin.wilder" <kevin.wilder@darkwolfsolutions.com>
Date: Mon, 1 Nov 2021 22:52:55 +0000
Subject: [PATCH] Gitlab istio injection

---
 chart/templates/gitlab/namespace.yaml |  2 +-
 chart/templates/gitlab/values.yaml    | 18 +++++++++++++++++-
 chart/values.yaml                     |  6 +++---
 3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/chart/templates/gitlab/namespace.yaml b/chart/templates/gitlab/namespace.yaml
index 945eb92e4f..08742c9d20 100644
--- a/chart/templates/gitlab/namespace.yaml
+++ b/chart/templates/gitlab/namespace.yaml
@@ -6,6 +6,6 @@ metadata:
     app.kubernetes.io/name: gitlab
     app.kubernetes.io/component: "developer-tools"
     {{- include "commonLabels" . | nindent 4}}
-    istio-injection: disabled
+    istio-injection: {{ dig "istio" "injection" "enabled" .Values.addons.gitlab }}
   name: gitlab
 {{- end }}
diff --git a/chart/templates/gitlab/values.yaml b/chart/templates/gitlab/values.yaml
index fa1a548895..4dfb888d58 100644
--- a/chart/templates/gitlab/values.yaml
+++ b/chart/templates/gitlab/values.yaml
@@ -42,6 +42,12 @@ registry:
     key: registry
 {{- end }}
 
+{{- if .Values.istio.enabled }}
+shared-secrets:
+  annotations:
+    sidecar.istio.io/inject: "false"
+{{- end }}
+
 gitlab:
   {{- if .Values.addons.gitlab.objectStorage.endpoint }}
   task-runner:
@@ -53,8 +59,18 @@ gitlab:
   {{- end }}
   gitlab-exporter:
     enabled: {{ .Values.monitoring.enabled }}
-
+  {{- if .Values.istio.enabled }}
+  migrations:
+    annotations:
+      sidecar.istio.io/inject: "false"
+  {{- end }}
+  
 global:
+
+  # added to help with Gitlab sub-chart configuration
+  istio:
+    enabled: {{ .Values.istio.enabled }}
+
   hosts:
     domain: {{ $domainName }}
 
diff --git a/chart/values.yaml b/chart/values.yaml
index e70d870673..607ecfdccd 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -591,7 +591,7 @@ addons:
     postRenderers: []
 
   gitlab:
-    # -- Toggle deployment of Gitlab
+    # -- Toggle deployment of Gitlab 
     enabled: false
 
     hostnames:
@@ -602,7 +602,7 @@ addons:
     git:
       repo: https://repo1.dso.mil/platform-one/big-bang/apps/developer-tools/gitlab.git
       path: "./chart"
-      tag: "5.3.1-bb.2"
+      tag: "5.3.1-bb.3"
 
     # -- Flux reconciliation overrides specifically for the Gitlab Package
     flux: {}
@@ -677,7 +677,7 @@ addons:
     git:
       repo: https://repo1.dso.mil/platform-one/big-bang/apps/developer-tools/gitlab-runner.git
       path: "./chart"
-      tag: "0.33.1-bb.3"
+      tag: "0.33.1-bb.4"
 
     # -- Flux reconciliation overrides specifically for the Gitlab Runner Package
     flux: {}
-- 
GitLab