From 2fb6a299a3a8840cafda9c46c15819a2c4e23c14 Mon Sep 17 00:00:00 2001 From: Dmitrii Kabanov Date: Wed, 10 Apr 2019 23:31:13 -0700 Subject: [PATCH] Add support of older versions of Helm This PS allows to avoid of using assignments which are not supported in older versions of Helm (GO<1.11). Change-Id: Ic0dad4d1b60071c4366c63834f1ad7e3a76fdcd8 --- divingbell/templates/bin/_apt.sh.tpl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/divingbell/templates/bin/_apt.sh.tpl b/divingbell/templates/bin/_apt.sh.tpl index 39142d1..981f3d6 100644 --- a/divingbell/templates/bin/_apt.sh.tpl +++ b/divingbell/templates/bin/_apt.sh.tpl @@ -59,18 +59,18 @@ load_package_list_with_versions $(dpkg -l | awk 'NR>5 {print $2"="$3}') {{- if hasKey .Values.conf "apt" }} {{- if hasKey .Values.conf.apt "repositories" }} - {{- $repository := list }} echo -n "" > /etc/apt/trusted.gpg.d/divindbell_temp.gpg +echo "#The list of repositories managed by Divingbell" > /etc/apt/sources.list.divingbell {{- range .Values.conf.apt.repositories }} {{- $url := .url }} {{- $components := .components | join " " }} {{- $subrepos := .subrepos | default list }} {{- range .distributions }} {{- $distribution := . }} - {{- $repository = append $repository ( printf "deb %s %s %s" $url $distribution $components ) }} +echo "{{ printf "deb %s %s %s" $url $distribution $components }}" >>/etc/apt/sources.list.divingbell {{- if $subrepos }} {{- range $subrepos }} - {{- $repository = append $repository ( printf "deb %s %s-%s %s" $url $distribution . $components ) }} +echo "{{ printf "deb %s %s-%s %s" $url $distribution . $components }}" >>/etc/apt/sources.list.divingbell {{- end }} {{- end }} {{- end }} @@ -80,10 +80,6 @@ apt-key --keyring /etc/apt/trusted.gpg.d/divindbell_temp.gpg add - <<"ENDKEY" ENDKEY {{- end }} {{- end }} -echo "#The list of repositories managed by Divingbell" > /etc/apt/sources.list.divingbell - {{- range $repository }} -echo "{{ . }}" >>/etc/apt/sources.list.divingbell - {{- end }} mv /etc/apt/sources.list.divingbell /etc/apt/sources.list rm -rf /etc/apt/sources.list.d/* mv /etc/apt/trusted.gpg.d/divindbell_temp.gpg /etc/apt/trusted.gpg.d/divindbell.gpg