Skip to content

Commit bd43f5f

Browse files
committed
Remove env.configFilePath and env.secretsFilePath
These utilize `.Files.Get` in Helm Per the Helm docs (https://helm.sh/docs/chart_template_guide/accessing_files/): > Some files cannot be accessed through the .Files object, usually for security reasons. > Files outside of a Helm application subchart, including those of the parent, cannot be accessed Because of this, `.env.configFilePath` and `env.secretsFilePath` are only ever usable if you have a copy of this repo in your local directory when installing. When installing the Helm chart through the https://helm.releases.hashicorp.com release, because the chart is pulled from the HashiCorp repo, these files are not considered a part of the chart, causing `.env.configFilePath` and `env.secretsFilePath` to always be a no-op. This has caused confusion on a support ticket, so I propose we remove these two values entirely. Examples/proof: Working because we edit the chart itself (install `.`) ```bash echo 'TFE_HOSTNAME: "testing"' > env-config.yaml helm template tfe . --set "env.configFilePath=`pwd`/env-config.yaml" ``` Not working because we are pulling from the HashiCorp repo ```bash echo 'TFE_HOSTNAME: "testing"' > env-config.yaml helm template tfe hashicorp/terraform-enterprise --set "env.configFilePath=`pwd`/env-config.yaml" ```
1 parent 961c003 commit bd43f5f

File tree

6 files changed

+0
-76
lines changed

6 files changed

+0
-76
lines changed

env-config.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

env-secrets.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

templates/_helpers.tpl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,6 @@ and base64 encodes the value.
8484
{{- end }}
8585
{{- end }}
8686

87-
{{/*
88-
Prints the file contents of the environment secrets file
89-
and base64 encodes the value from the key-value pair.
90-
*/}}
91-
{{- define "helpers.enc-b64-secrets-file" }}
92-
{{- range .Files.Lines .Values.env.secretsFilePath }}
93-
{{- $kv := splitList ":" . -}}
94-
{{- $k := first $kv -}}
95-
{{- if and ($k) (eq (hasPrefix "#" $k) false) }}
96-
{{ $k }}: {{ trim (last $kv) | b64enc }}
97-
{{- end }}
98-
{{- end }}
99-
{{- end }}
100-
10187
{{/*
10288
Define helper to conditionally add securityContext to agentWorkerPodTemplate.
10389
It does not output anything if agentWorkerPodTemplate is empty and OpenShift is not enabled.

templates/config-map.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,3 @@ data:
3030
TFE_METRICS_HTTP_PORT: "{{ .Values.tfe.metrics.httpPort }}"
3131
TFE_METRICS_HTTPS_PORT: "{{ .Values.tfe.metrics.httpsPort }}"
3232
{{- end }}
33-
{{- if .Values.env.configFilePath }}
34-
{{ .Files.Get .Values.env.configFilePath | indent 2 }}
35-
{{- end }}

templates/secret.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,3 @@ metadata:
3636
namespace: {{ .Release.Namespace }}
3737
data:
3838
{{- include "helpers.list-env-secrets" . | indent 2 }}
39-
{{- if .Values.env.secretsFilePath }}
40-
{{- include "helpers.enc-b64-secrets-file" . | indent 2 }}
41-
{{- end }}

values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,6 @@ openshift:
227227
enabled: false
228228

229229
env:
230-
# configFilePath: env-config.yaml
231-
# secretsFilePath: # env-secrets.yaml
232230
# configMapRefs:
233231
# - name:
234232
# secretRefs:

0 commit comments

Comments
 (0)