diff --git a/divingbell/templates/bin/_apt.sh.tpl b/divingbell/templates/bin/_apt.sh.tpl index 9a2b789..c80487d 100644 --- a/divingbell/templates/bin/_apt.sh.tpl +++ b/divingbell/templates/bin/_apt.sh.tpl @@ -282,9 +282,16 @@ while read -r name version; do fi done < <(apt-cache madison "${!package_info[@]}" | awk '!a[$1]++ {print $1 " " $3}') +whitelist=() +{{- if hasKey .Values.conf.apt "whitelistpkgs" }} +{{- range $v := .Values.conf.apt.whitelistpkgs }} +whitelist+=($v) +{{- end }} +{{- end }} + for pkg in "${!package_info[@]}"; do read -r before after available < <(echo "${package_info[$pkg]}") - if [[ "$after" != "N/A" && "$after" != "$available" ]]; then + if [[ "$after" != "N/A" && "$after" != "$available" && ! ${whitelist[*]} =~ "$pkg" ]]; then log.ERROR "Package $pkg was not properly installed/upgraded, installed version $after, available version $available" exit 1 fi diff --git a/divingbell/templates/daemonset-exec.yaml b/divingbell/templates/daemonset-exec.yaml index 2b69ef5..db3b6f2 100644 --- a/divingbell/templates/daemonset-exec.yaml +++ b/divingbell/templates/daemonset-exec.yaml @@ -14,7 +14,7 @@ # limitations under the License. */}} -{{- define "readinessProbeTemplate" }} +{{- define "readinessProbeExecTemplate" }} exec: command: - cat @@ -58,7 +58,7 @@ spec: imagePullPolicy: {{ .Values.images.pull_policy }} {{ tuple $envAll $envAll.Values.pod.resources.exec | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }} {{ dict "envAll" $envAll "application" "divingbell" "container" "exec" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }} -{{ dict "envAll" $envAll "component" "divingbell" "container" "exec" "type" "readiness" "probeTemplate" (include "readinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 8 }} +{{ dict "envAll" $envAll "component" "divingbell" "container" "exec" "type" "readiness" "probeTemplate" (include "readinessProbeExecTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 8 }} command: - /tmp/{{ $daemonset }}.sh volumeMounts: diff --git a/divingbell/values.yaml b/divingbell/values.yaml index cd5c18b..5ba1e2c 100644 --- a/divingbell/values.yaml +++ b/divingbell/values.yaml @@ -29,6 +29,7 @@ conf: upgrade: false allow_downgrade: false strict: false + whitelistpkgs: [] blacklistpkgs: - telnetd - inetutils-telnetd