Update mirror (#733)

This commit is contained in:
Shiming Zhang
2023-11-10 15:37:34 +08:00
committed by GitHub
parent 9c1dd5c15b
commit bd2f1550a7
3 changed files with 26 additions and 43 deletions

View File

@@ -2,4 +2,28 @@
export LC_ALL=C
cat $1 | sort -u | grep -v '^$' > $1.tmp && mv $1.tmp $1
function filter_docker_library() {
while read -r line; do
if [[ $line =~ ^docker\.io/[^/]*$ ]]; then
echo "docker.io/library/${line#docker.io/}"
else
echo "${line}"
fi
done
}
function filter_k8s_old() {
while read -r line; do
if [[ $line =~ ^k8s\.gcr\.io/[^/]*$ ]]; then
echo "registry.k8s.io/${line#k8s.gcr.io/}"
else
echo "${line}"
fi
done
}
cat $1 |
filter_docker_library |
filter_k8s_old |
sort -u |
grep -v '^$' >$1.tmp && mv $1.tmp $1