2021-08-11 14:14:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# This script delivers current documentation/configs and assures it has the intended
|
|
|
|
# settings for a particular branch/release.
|
|
|
|
# For questions reach to Jindrich Novy <jnovy@redhat.com>
|
|
|
|
|
|
|
|
ensure() {
|
|
|
|
if grep ^$2[[:blank:]].*= $1 > /dev/null
|
|
|
|
then
|
|
|
|
sed -i "s;^$2[[:blank:]]=.*;$2 = $3;" $1
|
|
|
|
else
|
|
|
|
if grep ^\#.*$2[[:blank:]].*= $1 > /dev/null
|
|
|
|
then
|
|
|
|
sed -i "/^#.*$2[[:blank:]].*=/a \
|
|
|
|
$2 = $3" $1
|
|
|
|
else
|
|
|
|
echo "$2 = \"$3\"" >> $1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
#./pyxis.sh
|
|
|
|
#./update-vendored.sh
|
|
|
|
spectool -f -g containers-common.spec
|
|
|
|
ensure storage.conf driver \"overlay\"
|
|
|
|
ensure storage.conf mountopt \"nodev,metacopy=on\"
|
|
|
|
if pwd | grep rhel-8 > /dev/null
|
|
|
|
then
|
|
|
|
ensure registries.conf unqualified-search-registries [\"registry.fedoraproject.org\",\ \"registry.access.redhat.com\",\ \"registry.centos.org\",\ \"docker.io\"]
|
|
|
|
ensure registries.conf short-name-mode \"permissive\"
|
|
|
|
ensure containers.conf infra_image \"registry.access.redhat.com/ubi8/pause\"
|
|
|
|
ensure containers.conf runtime \"runc\"
|
2021-11-30 11:25:22 +00:00
|
|
|
ensure containers.conf events_logger \"file\"
|
|
|
|
ensure containers.conf log_driver \"k8s-file\"
|
2021-08-11 14:14:36 +00:00
|
|
|
else
|
|
|
|
ensure registries.conf unqualified-search-registries [\"registry.fedoraproject.org\",\ \"registry.access.redhat.com\",\ \"registry.centos.org\",\ \"quay.io\",\ \"docker.io\"]
|
|
|
|
ensure registries.conf short-name-mode \"enforcing\"
|
2021-11-12 12:33:34 +00:00
|
|
|
ensure containers.conf infra_image \"registry.access.redhat.com/ubi8/pause\"
|
2021-08-11 14:14:36 +00:00
|
|
|
ensure containers.conf runtime \"crun\"
|
2021-11-30 11:25:22 +00:00
|
|
|
ensure containers.conf events_logger \"journald\"
|
|
|
|
ensure containers.conf log_driver \"journald\"
|
2021-08-11 14:14:36 +00:00
|
|
|
fi
|
|
|
|
[ `grep "keyctl" seccomp.json | wc -l` == 0 ] && sed -i '/\"kill\",/i \
|
|
|
|
"keyctl",' seccomp.json
|
|
|
|
sed -i '/\"socketcall\",/i \
|
|
|
|
"socket",' seccomp.json
|
|
|
|
if ! grep \"NET_RAW\" containers.conf > /dev/null
|
|
|
|
then
|
|
|
|
sed -i '/^default_capabilities/a \
|
|
|
|
"NET_RAW",' containers.conf
|
|
|
|
fi
|