remotes/docker/config: allow setting custom AuthorizerOpts
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
1a078e6893
commit
8094f50dd0
@ -63,7 +63,8 @@ type HostOptions struct {
|
|||||||
DefaultTLS *tls.Config
|
DefaultTLS *tls.Config
|
||||||
DefaultScheme string
|
DefaultScheme string
|
||||||
// UpdateClient will be called after creating http.Client object, so clients can provide extra configuration
|
// UpdateClient will be called after creating http.Client object, so clients can provide extra configuration
|
||||||
UpdateClient UpdateClientFunc
|
UpdateClient UpdateClientFunc
|
||||||
|
AuthorizerOpts []docker.AuthorizerOpt
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConfigureHosts creates a registry hosts function from the provided
|
// ConfigureHosts creates a registry hosts function from the provided
|
||||||
@ -143,6 +144,7 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos
|
|||||||
if options.Credentials != nil {
|
if options.Credentials != nil {
|
||||||
authOpts = append(authOpts, docker.WithAuthCreds(options.Credentials))
|
authOpts = append(authOpts, docker.WithAuthCreds(options.Credentials))
|
||||||
}
|
}
|
||||||
|
authOpts = append(authOpts, options.AuthorizerOpts...)
|
||||||
authorizer := docker.NewDockerAuthorizer(authOpts...)
|
authorizer := docker.NewDockerAuthorizer(authOpts...)
|
||||||
|
|
||||||
rhosts := make([]docker.RegistryHost, len(hosts))
|
rhosts := make([]docker.RegistryHost, len(hosts))
|
||||||
|
Loading…
Reference in New Issue
Block a user