From 183866dd97da69965245546318068338d105531c Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Wed, 16 Oct 2019 14:32:11 -0700 Subject: [PATCH] Adding a config.toml value to the helm chart Fixes https://github.com/gomods/athens/issues/1405 cc/ @hypnoglow --- .../athens-proxy/templates/config-configtoml.yaml | 14 ++++++++++++++ charts/athens-proxy/templates/deployment.yaml | 10 ++++++++++ charts/athens-proxy/values.yaml | 10 ++++++++++ 3 files changed, 34 insertions(+) create mode 100644 charts/athens-proxy/templates/config-configtoml.yaml diff --git a/charts/athens-proxy/templates/config-configtoml.yaml b/charts/athens-proxy/templates/config-configtoml.yaml new file mode 100644 index 000000000..8af84faac --- /dev/null +++ b/charts/athens-proxy/templates/config-configtoml.yaml @@ -0,0 +1,14 @@ +{{- if .Values.configToml.enabled -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-configtoml + labels: + app: {{ template "fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +data: + config.toml: |- + {{ .Values.configToml.data }} +{{- end -}} diff --git a/charts/athens-proxy/templates/deployment.yaml b/charts/athens-proxy/templates/deployment.yaml index c475af4cc..71a4f44d2 100644 --- a/charts/athens-proxy/templates/deployment.yaml +++ b/charts/athens-proxy/templates/deployment.yaml @@ -155,6 +155,11 @@ spec: mountPath: "/usr/local/lib" readOnly: true {{- end }} + {{- if .Values.configToml}} + - name: configtoml + mountPath: "/config" + readOnly: true + {{- end }} {{- if .Values.netrc.enabled }} - name: netrc mountPath: "/etc/netrc" @@ -192,6 +197,11 @@ spec: configMap: name: {{ template "fullname" . }}-upstream {{- end }} + {{- if .Values.configToml.enabled }} + - name: configtoml-config + configMap: + name: {{ template "fullname" .}}-configtoml + {{- end }} {{- if .Values.netrc.enabled }} - name: netrc secret: diff --git a/charts/athens-proxy/values.yaml b/charts/athens-proxy/values.yaml index dda399494..6405435a6 100644 --- a/charts/athens-proxy/values.yaml +++ b/charts/athens-proxy/values.yaml @@ -82,6 +82,16 @@ gitconfig: # Key in the kubernetes secret that contains git config data. secretKey: gitconfig +configToml: + enabled: false + data: |- + # See https://docs.gomods.io/configuration/ for an introduction on what + # values you can put in here. + # + # Otherwise, for an exhaustive list of the configuration values you + # can put here, see config.dev.toml at the root of the + # github.com/gomods/athens repository + upstreamProxy: # This is where you can set the URL for the upstream module repository. # If 'enabled' is set to true, Athens will try to download modules from the upstream when it doesn't find them in its own storage.