containers-common/update.sh
Lokesh Mandvekar 9a27ad528d
bump to v0.57.3
check if `short-name-mode="enforcing"` exists in registries.conf and
enabled.

Remove `-e` option from update.sh to not exit on non-zero error at
finding `short-name-mode="enforcing"`.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-02-01 17:16:21 +05:30

34 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -ox pipefail
spectool -fg containers-common.spec
if [[ $(git rev-parse --abbrev-ref HEAD) == "rawhide" ]]; then
sed -i -e 's/^driver.*=.*/driver = "overlay"/' -e 's/^mountopt.*=.*/mountopt = "nodev,metacopy=on"/' \
-e 's/^pull_options.*=.*/pull_options = {enable_partial_images = \"true\", use_hard_links = \"false\", ostree_repos=""}/' \
storage.conf
else
sed -i -e 's/^driver.*=.*/driver = "overlay"/' -e 's/^mountopt.*=.*/mountopt = "nodev,metacopy=on"/' \
-e '/additionalimage.*/a "/usr/lib/containers/storage",' \
storage.conf
fi
[ `grep "keyctl" seccomp.json | wc -l` == 0 ] && sed -i '/\"kill\",/i \
"keyctl",' seccomp.json
sed -i '/\"socketcall\",/i \
"socket",' seccomp.json
sed -i 's/^#.*unqualified-search-registries.*=.*/unqualified-search-registries = ["registry.fedoraproject.org", "registry.access.redhat.com", "docker.io", "quay.io"]/g' \
registries.conf
grep '^short-name-mode="enforcing"' registries.conf
if [[ $? == 1 ]]; then
echo -e '\nshort-name-mode="enforcing"' >> registries.conf
fi
sed -i -e 's/^#.*log_driver.*=.*/log_driver = "journald"/' \
containers.conf
git checkout origin default-policy.json