Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate_config.sh 脚本有bug #950

Open
hust-suwb opened this issue Feb 25, 2025 · 1 comment
Open

generate_config.sh 脚本有bug #950

hust-suwb opened this issue Feb 25, 2025 · 1 comment

Comments

@hust-suwb
Copy link

hust-suwb commented Feb 25, 2025

generate_config.sh

# RegistryURI
if [ "$RegistryURI" != "" ]; then

	if [ "${RegistryURI: -1}" != "/" ]; then
		RegistryURI="${RegistryURI}/"
	fi
	
	sed -i "s#RegistryURI=.*#RegistryURI=${RegistryURI}/#g" ./confs-"$party_id"/.env
fi

这一部分代码,如果用户设置了RegistryURI,不论RegistryURI是否有使用/结尾,,也就是不论
RegistryURI = hub.c.163.com
RegistryURI = hub.c.163.com/

程序执行完毕后都会变成 RegistryURI = hub.c.163.com//,多了个斜杠。而这会导致镜像拉取时报异常ERROR: invalid reference format

建议修改为:

if [ "$RegistryURI" != "" ]; then

	if [ "${RegistryURI: -1}" != "/" ]; then
		RegistryURI="${RegistryURI}/"
	fi
	
	sed -i "s#RegistryURI=.*#RegistryURI=${RegistryURI}#g" ./confs-"$party_id"/.env
fi

也即,去掉后面sed中额外添加的斜杠。

@kikyoulg
Copy link

项目应该凉了吧,没人了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants