Skip to content

Commit eb25547

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 9863788 commit eb25547

File tree

6 files changed

+0
-81
lines changed

6 files changed

+0
-81
lines changed

env-config.yaml

Lines changed: 0 additions & 47 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
@@ -34,6 +34,3 @@ data:
3434
TFE_METRICS_HTTP_PORT: "{{ .Values.tfe.metrics.httpPort }}"
3535
TFE_METRICS_HTTPS_PORT: "{{ .Values.tfe.metrics.httpsPort }}"
3636
{{- end }}
37-
{{- if .Values.env.configFilePath }}
38-
{{ .Files.Get .Values.env.configFilePath | indent 2 }}
39-
{{- end }}

templates/secret.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,3 @@ metadata:
5050
namespace: {{ .Release.Namespace }}
5151
data:
5252
{{- include "helpers.list-env-secrets" . | indent 2 }}
53-
{{- if .Values.env.secretsFilePath }}
54-
{{- include "helpers.enc-b64-secrets-file" . | indent 2 }}
55-
{{- end }}

values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ openshift:
264264
enabled: false
265265

266266
env:
267-
# configFilePath: env-config.yaml
268-
# secretsFilePath: # env-secrets.yaml
269267
# configMapRefs:
270268
# - name:
271269
# secretRefs:

0 commit comments

Comments
 (0)