Skip to content

Commit 311f182

Browse files
committed
Inverting createKubernetesSecrets -> disableKubernetesSecrets
1 parent db4973a commit 311f182

File tree

10 files changed

+20
-16
lines changed

10 files changed

+20
-16
lines changed

charts/sourcegraph/templates/_helpers.tpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ For top-level services, pass in the top-level values:
4545
{{ include "sourcegraph.serviceAccountName" (list . "frontend") }}
4646

4747
frontend:
48-
serivceAccount:
48+
serviceAccount:
4949
create: false
5050

5151
For nested services, pass in the nested values:
@@ -249,7 +249,12 @@ app.kubernetes.io/name: jaeger
249249
{{- end }}
250250

251251
{{- define "sourcegraph.redisConnection" -}}
252-
{{- if .Values.sourcegraph.createKubernetesSecrets -}}
252+
{{- if .Values.sourcegraph.disableKubernetesSecrets -}}
253+
- name: REDIS_CACHE_ENDPOINT
254+
value: {{ .Values.sourcegraph.redisCacheEndpoint }}
255+
- name: REDIS_STORE_ENDPOINT
256+
value: {{ .Values.sourcegraph.redisStoreEndpoint }}
257+
{{- else -}}
253258
- name: REDIS_CACHE_ENDPOINT
254259
valueFrom:
255260
secretKeyRef:
@@ -260,11 +265,6 @@ app.kubernetes.io/name: jaeger
260265
secretKeyRef:
261266
key: endpoint
262267
name: {{ default .Values.redisStore.name .Values.redisStore.connection.existingSecret }}
263-
{{- else -}}
264-
- name: REDIS_CACHE_ENDPOINT
265-
value: {{ .Values.sourcegraph.redisCacheEndpoint }}
266-
- name: REDIS_STORE_ENDPOINT
267-
value: {{ .Values.sourcegraph.redisStoreEndpoint }}
268268
{{- end -}}
269269
{{- end -}}
270270

charts/sourcegraph/templates/codeinsights-db/codeinsights-db.Secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.sourcegraph.createKubernetesSecrets (not .Values.codeInsightsDB.auth.existingSecret) -}}
1+
{{- if and (not .Values.sourcegraph.disableKubernetesSecrets) (not .Values.codeInsightsDB.auth.existingSecret) -}}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/sourcegraph/templates/codeintel-db/codeintel-db.Secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.sourcegraph.createKubernetesSecrets (not .Values.codeIntelDB.auth.existingSecret) -}}
1+
{{- if and (not .Values.sourcegraph.disableKubernetesSecrets) (not .Values.codeIntelDB.auth.existingSecret) -}}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/sourcegraph/templates/frontend/sourcegraph-frontend.Deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ spec:
5454
imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }}
5555
args: {{- default (list "up") .Values.migrator.args | toYaml | nindent 8 }}
5656
env:
57-
{{- if not .Values.migrator.databaseAuthOverrideEnvVars }}
57+
{{- if and (not .Values.migrator.databaseAuthOverrideEnvVars) (not .Values.sourcegraph.disableKubernetesSecrets) }}
5858
{{- include "sourcegraph.databaseAuth" (list . "pgsql" "PG") | nindent 8 }}
5959
{{- include "sourcegraph.databaseAuth" (list . "codeIntelDB" "CODEINTEL_PG") | nindent 8 }}
6060
{{- include "sourcegraph.databaseAuth" (list . "codeInsightsDB" "CODEINSIGHTS_PG") | nindent 8 }}
@@ -80,9 +80,11 @@ spec:
8080
imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }}
8181
args: {{- default (list "serve") .Values.frontend.args | toYaml | nindent 8 }}
8282
env:
83+
{{- if not .Values.sourcegraph.disableKubernetesSecrets }}
8384
{{- include "sourcegraph.databaseAuth" (list . "pgsql" "PG") | nindent 8 }}
8485
{{- include "sourcegraph.databaseAuth" (list . "codeIntelDB" "CODEINTEL_PG") | nindent 8 }}
8586
{{- include "sourcegraph.databaseAuth" (list . "codeInsightsDB" "CODEINSIGHTS_PG") | nindent 8 }}
87+
{{- end }}
8688
{{- range $name, $item := .Values.frontend.env}}
8789
- name: {{ $name }}
8890
{{- $item | toYaml | nindent 10 }}

charts/sourcegraph/templates/grafana/grafana.StatefulSet.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ spec:
5252
{{- end }}
5353
terminationMessagePolicy: FallbackToLogsOnError
5454
env:
55+
{{- if not .Values.sourcegraph.disableKubernetesSecrets -}}
5556
{{- include "sourcegraph.databaseAuth" (list . "grafana" "GRAFANA_PGSQL_") | nindent 8 }}
57+
{{- end -}}
5658
{{- range $name, $item := .Values.grafana.env}}
5759
- name: {{ $name }}
5860
{{- $item | toYaml | nindent 10 }}

charts/sourcegraph/templates/grafana/grafana.pgsql.Secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.sourcegraph.createKubernetesSecrets .Values.grafana.auth (not .Values.grafana.auth.existingSecret) -}}
1+
{{- if and (not .Values.sourcegraph.disableKubernetesSecrets) .Values.grafana.auth (not .Values.grafana.auth.existingSecret) -}}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/sourcegraph/templates/pgsql/pgsql.Secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.sourcegraph.createKubernetesSecrets (not .Values.pgsql.auth.existingSecret) -}}
1+
{{- if and (not .Values.sourcegraph.disableKubernetesSecrets) (not .Values.pgsql.auth.existingSecret) -}}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/sourcegraph/templates/redis/redis-cache.Secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.sourcegraph.createKubernetesSecrets (not .Values.redisCache.connection.existingSecret) -}}
1+
{{- if and (not .Values.sourcegraph.disableKubernetesSecrets) (not .Values.redisCache.connection.existingSecret) -}}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/sourcegraph/templates/redis/redis-store.Secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.sourcegraph.createKubernetesSecrets (not .Values.redisStore.connection.existingSecret) -}}
1+
{{- if and (not .Values.sourcegraph.disableKubernetesSecrets) (not .Values.redisStore.connection.existingSecret) -}}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/sourcegraph/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ sourcegraph:
3838
revisionHistoryLimit: 10
3939
# -- Add extra labels to all services
4040
serviceLabels: {}
41-
# -- Create Kubernetes secrets objects
42-
createKubernetesSecrets: true
41+
# -- Disable the creation of Kubernetes secrets objects
42+
disableKubernetesSecrets: false
4343

4444
# Generic application configuration options, used by most applications below
4545
# app: # Generally matches directory name

0 commit comments

Comments
 (0)