|
|
@ -87,6 +87,8 @@ func NewClient(options ...ClientOption) (*Client, error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
client.authorizer = authClient
|
|
|
|
client.authorizer = authClient
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if client.resolver == nil {
|
|
|
|
client.resolver = func(ref registry.Reference) (remotes.Resolver, error) {
|
|
|
|
client.resolver = func(ref registry.Reference) (remotes.Resolver, error) {
|
|
|
|
headers := http.Header{}
|
|
|
|
headers := http.Header{}
|
|
|
|
headers.Set("User-Agent", version.GetUserAgent())
|
|
|
|
headers.Set("User-Agent", version.GetUserAgent())
|
|
|
@ -117,6 +119,8 @@ func NewClient(options ...ClientOption) (*Client, error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return resolver, nil
|
|
|
|
return resolver, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// allocate a cache if option is set
|
|
|
|
// allocate a cache if option is set
|
|
|
|
var cache registryauth.Cache
|
|
|
|
var cache registryauth.Cache
|
|
|
|
if client.enableCache {
|
|
|
|
if client.enableCache {
|
|
|
@ -202,7 +206,9 @@ func ClientOptPlainHTTP() ClientOption {
|
|
|
|
// ClientOptResolver returns a function that sets the resolver setting on a client options set
|
|
|
|
// ClientOptResolver returns a function that sets the resolver setting on a client options set
|
|
|
|
func ClientOptResolver(resolver remotes.Resolver) ClientOption {
|
|
|
|
func ClientOptResolver(resolver remotes.Resolver) ClientOption {
|
|
|
|
return func(client *Client) {
|
|
|
|
return func(client *Client) {
|
|
|
|
client.resolver = resolver
|
|
|
|
client.resolver = func(ref registry.Reference) (remotes.Resolver, error) {
|
|
|
|
|
|
|
|
return resolver, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|