From 41e9454a590f4f9409242078deb55317c80f24eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=AF=E8=88=AA?= <101104760+ZhangSetSail@users.noreply.github.com> Date: Fri, 22 Nov 2024 01:41:42 +0800 Subject: [PATCH] fix: create hub client failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张启航 <101104760+ZhangSetSail@users.noreply.github.com> --- builder/sources/registry/registry.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/builder/sources/registry/registry.go b/builder/sources/registry/registry.go index b9b306750..09bd20038 100644 --- a/builder/sources/registry/registry.go +++ b/builder/sources/registry/registry.go @@ -116,11 +116,9 @@ func newFromTransport(registryURL, username, password string, transport http.Rou if containsScheme { url = strings.Replace(url, "http", "https", 1) } - logrus.Infof("username: %v", username) if username != "" { transport = WrapTransport(transport, url, username, password) } - logrus.Infof("url: %v", url) registry := &Registry{ URL: url, Client: &http.Client{ @@ -131,12 +129,12 @@ func newFromTransport(registryURL, username, password string, transport http.Rou if err := registry.Ping(); err != nil { if err != nil { - logrus.Infof("---------in") + url = strings.Replace(url, "https", "http", 1) if username != "" { transport = WrapTransport(transport, url, username, password) } registry := &Registry{ - URL: strings.Replace(url, "https", "http", 1), + URL: url, Client: &http.Client{ Transport: transport, },