From 3d7649c23d1ef137591609597464878b43e9c23a Mon Sep 17 00:00:00 2001 From: kristofkalocsai Date: Thu, 7 Oct 2021 19:52:30 +0200 Subject: [PATCH 1/2] replaces ERB with gomplate --- charts/gitlab/charts/gitlab-shell/templates/configmap.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/gitlab/charts/gitlab-shell/templates/configmap.yml b/charts/gitlab/charts/gitlab-shell/templates/configmap.yml index 9e3659c446..0013415602 100644 --- a/charts/gitlab/charts/gitlab-shell/templates/configmap.yml +++ b/charts/gitlab/charts/gitlab-shell/templates/configmap.yml @@ -13,7 +13,7 @@ data: mkdir -p /${secret_dir}/ssh cp -v -r -L /${config_dir}/ssh_host_* /${secret_dir}/ssh/ chmod 0400 /${secret_dir}/ssh/ssh_host_* - config.yml.erb: | + config.yml.tpl: | # GitLab user. git by default user: git @@ -58,9 +58,9 @@ data: concurrent_sessions_limit: {{ .Values.config.maxStartups.full }} # SSH host key files. host_key_files: - <% Dir["/etc/ssh/ssh_host_*_key"].each do |file| %> - <%= "- #{file}" %> - <% end %> + {%- range (file.ReadDir "/etc/ssh/") %} + {% if ( . | regexp.Match `^ssh_host_.+_key`) %} {%- strings.Indent 2 "- " %} {%.%} {%- end -%} + {%- end -%} {{- end }} # Leave this here - This line denotes end of block to the parser. {{- end }} -- GitLab From de6bc4e0604bbabfe0da81d232bd7ed8d21c40bc Mon Sep 17 00:00:00 2001 From: kristofkalocsai Date: Fri, 8 Oct 2021 21:23:21 +0200 Subject: [PATCH 2/2] replaces ReadDir to Walk to get full path of files Changelog: fixed --- charts/gitlab/charts/gitlab-shell/templates/configmap.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/charts/gitlab/charts/gitlab-shell/templates/configmap.yml b/charts/gitlab/charts/gitlab-shell/templates/configmap.yml index 0013415602..c3da936b4e 100644 --- a/charts/gitlab/charts/gitlab-shell/templates/configmap.yml +++ b/charts/gitlab/charts/gitlab-shell/templates/configmap.yml @@ -58,9 +58,11 @@ data: concurrent_sessions_limit: {{ .Values.config.maxStartups.full }} # SSH host key files. host_key_files: - {%- range (file.ReadDir "/etc/ssh/") %} - {% if ( . | regexp.Match `^ssh_host_.+_key`) %} {%- strings.Indent 2 "- " %} {%.%} {%- end -%} - {%- end -%} + {%- range file.Walk "/etc/ssh" %} + {%- if filepath.Match "/etc/ssh/ssh_host_*_key" . %} + - {%.%} + {%- end %} + {%- end %} {{- end }} # Leave this here - This line denotes end of block to the parser. {{- end }} -- GitLab