fix dockerhub default host bug (#534)

Signed-off-by: Adam Martin <adam.martin@ranchergovernment.com>
This commit is contained in:
Adam Martin
2026-03-18 23:24:05 -04:00
committed by GitHub
parent 47479b1fa2
commit 268485f6d6

View File

@@ -47,6 +47,10 @@ func NewRegistryTarget(host string, opts RegistryOptions) *RegistryTarget {
)
hosts := func(h string) ([]cdocker.RegistryHost, error) {
host, err := cdocker.DefaultHost(h)
if err != nil {
return nil, err
}
scheme := "https"
if opts.PlainHTTP || opts.Insecure {
scheme = "http"
@@ -55,7 +59,7 @@ func NewRegistryTarget(host string, opts RegistryOptions) *RegistryTarget {
Client: http.DefaultClient,
Authorizer: authorizer,
Scheme: scheme,
Host: h,
Host: host,
Path: "/v2",
Capabilities: cdocker.HostCapabilityPull | cdocker.HostCapabilityResolve | cdocker.HostCapabilityPush,
}}, nil