diff --git a/deploy/kubernetes/helm/sloth/templates/deployment.yaml b/deploy/kubernetes/helm/sloth/templates/deployment.yaml index f4b75491..767d68bf 100644 --- a/deploy/kubernetes/helm/sloth/templates/deployment.yaml +++ b/deploy/kubernetes/helm/sloth/templates/deployment.yaml @@ -69,6 +69,13 @@ spec: name: metrics protocol: TCP {{- end }} + {{- if .Values.extraEnv }} + env: + {{- range $key, $value := .Values.extraEnv }} + — name: {{ $key }} + value: {{ $value }} + {{- end }} + {{- end}} {{- if or .Values.commonPlugins.enabled .Values.customSloConfig.enabled }} volumeMounts: {{- if .Values.commonPlugins.enabled }} @@ -98,6 +105,13 @@ spec: - --branch={{.Values.commonPlugins.gitRepo.branch}} - --wait=30 - --webhook-url=http://localhost:8082/-/reload + {{- if .Values.commonPlugins.extraEnv }} + env: + {{- range $key, $value := .Values.commonPlugins.extraEnv }} + — name: {{ $key }} + value: {{ $value }} + {{- end }} + {{- end}} volumeMounts: - name: sloth-common-sli-plugins # Default path for git-sync. diff --git a/deploy/kubernetes/helm/sloth/tests/values_test.go b/deploy/kubernetes/helm/sloth/tests/values_test.go index bbfcc51e..537f1960 100644 --- a/deploy/kubernetes/helm/sloth/tests/values_test.go +++ b/deploy/kubernetes/helm/sloth/tests/values_test.go @@ -16,6 +16,11 @@ func customValues() msi { "repository": "slok/sloth-test", "tag": "v1.42.42", }, + + "extraEnv": msi{ + "CUSTOM_ENV": "customValue", + "SECOND_ENV": "secondValue", + }, "sloth": msi{ "resyncInterval": "17m", @@ -35,6 +40,10 @@ func customValues() msi { "url": "https://github.com/slok/sloth-test-common-sli-plugins", "branch": "main", }, + "extraEnv": msi{ + "CUSTOM_PLUGIN_ENV": "customValue", + "SECOND_PLUGIN_ENV": "secondValue", + }, }, "metrics": msi{