-
Notifications
You must be signed in to change notification settings - Fork 579
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
私有仓库配置如何配置http协议? #1872
Comments
找到了个参考资料:google/go-containerregistry#1874 |
现在网关用来拉取镜像的代码摘录如下: https://github.com/higress-group/istio/blob/istio-1.19/pkg/wasm/imagefetcher.go#L93 ref, err := name.ParseReference(url) // <------ #1
if err != nil {
err = fmt.Errorf("could not parse url in image reference: %v", err)
return
}
wasmLog.Infof("fetching image %s from registry %s with tag %s", ref.Context().RepositoryStr(),
ref.Context().RegistryStr(), ref.Identifier())
// fallback to http based request, inspired by [helm](https://github.com/helm/helm/blob/12f1bc0acdeb675a8c50a78462ed3917fb7b2e37/pkg/registry/client.go#L594)
// only deal with https fallback instead of attributing all other type of errors to URL parsing error
desc, err := remote.Get(ref, o.fetchOpts...)
if err != nil && strings.Contains(err.Error(), "server gave HTTP response") { // <------ #2
wasmLog.Infof("fetching image with plain text from %s", url)
ref, err = name.ParseReference(url, name.Insecure)
if err == nil {
desc, err = remote.Get(ref, o.fetchOpts...)
}
} 可以看到在 1 号位置,是按照默认配置来解析 我在本地使用 而按照上面贴的日志,服务端是直接关闭了连接。这个行为似乎不符合预期: 建议从这个角度来分析。 |
higress-gateway加载wasm默认使用https协议与仓库建连,尝试添加环境变量
WASM_INSECURE_REGISTRIES
,或在oci URL的镜像仓库上添加80端口,均无法解决,想问一下有什么办法可以将默认协议修改为http的嘛?The text was updated successfully, but these errors were encountered: