Mantain mirror (#795)

This commit is contained in:
Shiming Zhang
2023-11-10 17:44:41 +08:00
committed by GitHub
parent 45aee54e98
commit b20b9daf42
5 changed files with 77 additions and 21 deletions

25
hack/fmt-image.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
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 >$1.tmp && mv $1.tmp $1