remotes/docker: remove deprecated NewAuthorizer alias
This was deprecated since containerd v1.3.0. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c71a311561
commit
f0ce2f6d36
@ -45,13 +45,6 @@ type dockerAuthorizer struct {
|
|||||||
onFetchRefreshToken OnFetchRefreshToken
|
onFetchRefreshToken OnFetchRefreshToken
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewAuthorizer creates a Docker authorizer using the provided function to
|
|
||||||
// get credentials for the token server or basic auth.
|
|
||||||
// Deprecated: Use NewDockerAuthorizer
|
|
||||||
func NewAuthorizer(client *http.Client, f func(string) (string, string, error)) Authorizer {
|
|
||||||
return NewDockerAuthorizer(WithAuthClient(client), WithAuthCreds(f))
|
|
||||||
}
|
|
||||||
|
|
||||||
type authorizerConfig struct {
|
type authorizerConfig struct {
|
||||||
credentials func(string) (string, string, error)
|
credentials func(string) (string, string, error)
|
||||||
client *http.Client
|
client *http.Client
|
||||||
|
@ -68,11 +68,15 @@ func TestBasicResolver(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
base, options, close := tlsServer(wrapped)
|
base, options, close := tlsServer(wrapped)
|
||||||
|
authorizer := NewDockerAuthorizer(
|
||||||
|
WithAuthClient(options.Client),
|
||||||
|
WithAuthCreds(func(host string) (string, string, error) {
|
||||||
|
return "user1", "password1", nil
|
||||||
|
}),
|
||||||
|
)
|
||||||
options.Hosts = ConfigureDefaultRegistries(
|
options.Hosts = ConfigureDefaultRegistries(
|
||||||
WithClient(options.Client),
|
WithClient(options.Client),
|
||||||
WithAuthorizer(NewAuthorizer(options.Client, func(string) (string, string, error) {
|
WithAuthorizer(authorizer),
|
||||||
return "user1", "password1", nil
|
|
||||||
})),
|
|
||||||
)
|
)
|
||||||
return base, options, close
|
return base, options, close
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user