apt: Add whitelist for strict mode
This change adds a whitelist of packages that will be ignored when using strict mode. Change-Id: I9138f35a72618100e6094575271f6160336332f4 Signed-off-by: Drew Walters <andrew.walters@att.com>
This commit is contained in:
parent
3cc1620319
commit
fe270ec595
@ -193,9 +193,26 @@ if [ -f ${persist_path}/packages ]; then
|
||||
{{- end }}
|
||||
if [ ! -z "$TO_DELETE" ]; then
|
||||
dpkg --configure -a
|
||||
|
||||
{{- if hasKey .Values.conf.apt "whitelistpkgs" }}
|
||||
WHITELIST=({{ include "helm-toolkit.utils.joinListWithSpace" .Values.conf.apt.whitelistpkgs }})
|
||||
{{- end }}
|
||||
PURGE_LIST=""
|
||||
while read -r pkg; do
|
||||
{{- if hasKey .Values.conf.apt "whitelistpkgs" }}
|
||||
found=false
|
||||
for item in "${WHITELIST[@]}"; do
|
||||
if [[ "${item}" == "${pkg}" ]]; then
|
||||
found=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ "${found}" == "false" ]]; then
|
||||
PURGE_LIST="$PURGE_LIST $pkg"
|
||||
fi
|
||||
{{- else }}
|
||||
PURGE_LIST="$PURGE_LIST $pkg"
|
||||
{{- end }}
|
||||
done <<< "$TO_DELETE"
|
||||
DEBIAN_FRONTEND=noninteractive $APT_PURGE $PURGE_LIST
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user