Skip to content

Commit 6d7ddf2

Browse files
committed
allow external secrets to potentially clobber other secrets if opted in
1 parent 1852808 commit 6d7ddf2

File tree

10 files changed

+20
-7
lines changed

10 files changed

+20
-7
lines changed

charts/retool/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: retool
33
description: A Helm chart for Kubernetes
44
type: application
5-
version: 6.3.2
5+
version: 6.3.3
66
maintainers:
77
- name: Retool Engineering
88
email: engineering+helm@retool.com

charts/retool/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,10 @@ Usage: (template "retool.codeExecutor.image.tag" .)
351351
{{- end -}}
352352
{{- $output -}}
353353
{{- end -}}
354+
355+
{{/*
356+
Checks whether or not ExternalSecret definitions are enabled and can potentially clobber secrets or explicitly allow additional direct secret refs.
357+
*/}}
358+
{{- define "checkExternalSecretsClobbering" -}}
359+
{{- or (not (or (.Values.externalSecrets.enabled) (.Values.externalSecrets.externalSecretsOperator.enabled))) .Values.allowOtherSecrets -}}
360+
{{- end -}}

charts/retool/templates/deployment_backend.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ spec:
153153

154154
{{- include "retool.telemetry.includeEnvVars" . | nindent 10 }}
155155

156-
{{- if and (not .Values.externalSecrets.enabled) (not .Values.externalSecrets.externalSecretsOperator.enabled) }}
156+
{{- if (include "checkExternalSecretsClobbering" .) }}
157157
- name: LICENSE_KEY
158158
valueFrom:
159159
secretKeyRef:

charts/retool/templates/deployment_jobs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ spec:
9191

9292
{{- include "retool.telemetry.includeEnvVars" . | nindent 10 }}
9393

94-
{{- if and (not .Values.externalSecrets.enabled) (not .Values.externalSecrets.externalSecretsOperator.enabled) }}
94+
{{- if (include "checkExternalSecretsClobbering" .) }}
9595
- name: LICENSE_KEY
9696
valueFrom:
9797
secretKeyRef:

charts/retool/templates/deployment_telemetry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ spec:
5252
value: "/host/proc"
5353
- name: SYSFS_ROOT
5454
value: "/host/sys"
55-
{{- if and (not .Values.externalSecrets.enabled) (not .Values.externalSecrets.externalSecretsOperator.enabled) }}
55+
{{- if (include "checkExternalSecretsClobbering" .) }}
5656
- name: LICENSE_KEY
5757
valueFrom:
5858
secretKeyRef:

charts/retool/templates/deployment_workflows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ spec:
141141
- name: CODE_EXECUTOR_INGRESS_DOMAIN
142142
value: http://{{ template "retool.codeExecutor.name" . }}
143143
{{- end }}
144-
{{- if and (not .Values.externalSecrets.enabled) (not .Values.externalSecrets.externalSecretsOperator.enabled) }}
144+
{{- if (include "checkExternalSecretsClobbering" .) }}
145145
- name: LICENSE_KEY
146146
valueFrom:
147147
secretKeyRef:

charts/retool/templates/deployment_workflows_worker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ spec:
150150
- name: OTEL_EXPORTER_OTLP_ENDPOINT
151151
value: "http://$(HOST_IP):4317"
152152
{{- end }}
153-
{{- if and (not .Values.externalSecrets.enabled) (not .Values.externalSecrets.externalSecretsOperator.enabled) }}
153+
{{- if (include "checkExternalSecretsClobbering" .) }}
154154
- name: LICENSE_KEY
155155
valueFrom:
156156
secretKeyRef:

charts/retool/templates/secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and (not .Values.externalSecrets.enabled) (not .Values.externalSecrets.externalSecretsOperator.enabled) }}
1+
{{- if (include "checkExternalSecretsClobbering" .) }}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/retool/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ externalSecrets:
9595
# Support for legacy external secrets, note this is deprecated in favour of External Secrets Operator: https://github.com/godaddy/kubernetes-external-secrets
9696
# This mode only allows a single secret name to be provided.
9797
enabled: false
98+
# If external secrets are currently enabled, it is disallowed to specify regular configuration secrets as a safeguard from clobbering.
99+
# This flag allows bypassing that check and specifying both an ExternalSecret and a regular secret for different secrets.
100+
allowOtherSecrets: false
98101
name: retool-config
99102
# Array of secrets to be use as env variables. (Optional)
100103
secrets:

values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ externalSecrets:
9595
# Support for legacy external secrets, note this is deprecated in favour of External Secrets Operator: https://github.com/godaddy/kubernetes-external-secrets
9696
# This mode only allows a single secret name to be provided.
9797
enabled: false
98+
# If external secrets are currently enabled, it is disallowed to specify regular configuration secrets as a safeguard from clobbering.
99+
# This flag allows bypassing that check and specifying both an ExternalSecret and a regular secret for different secrets.
100+
allowOtherSecrets: false
98101
name: retool-config
99102
# Array of secrets to be use as env variables. (Optional)
100103
secrets:

0 commit comments

Comments
 (0)