Add whitelist of packages to bypass verification

Change-Id: I459f4a241496cf98bd0bb00f3843f2b58bb397c1
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This commit is contained in:
Ruslan Aliev 2023-05-15 16:00:39 -05:00
parent 234248c272
commit 9ef6046f33
2 changed files with 9 additions and 3 deletions

View File

@ -282,9 +282,15 @@ while read -r name version; do
fi
done < <(apt-cache madison "${!package_info[@]}" | awk '!a[$1]++ {print $1 " " $3}')
{{- if hasKey .Values.conf.apt "whitelistpkgs" }}
whitelist=({{ join " " .Values.conf.apt.whitelistpkgs }})
{{- else }}
whitelist=()
{{- 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

View File

@ -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: