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:
Sebastiaan van Stijn 2022-10-13 23:58:24 +02:00
parent c71a311561
commit f0ce2f6d36
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 7 additions and 10 deletions

View File

@ -45,13 +45,6 @@ type dockerAuthorizer struct {
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 {
credentials func(string) (string, string, error)
client *http.Client

View File

@ -68,11 +68,15 @@ func TestBasicResolver(t *testing.T) {
})
base, options, close := tlsServer(wrapped)
authorizer := NewDockerAuthorizer(
WithAuthClient(options.Client),
WithAuthCreds(func(host string) (string, string, error) {
return "user1", "password1", nil
}),
)
options.Hosts = ConfigureDefaultRegistries(
WithClient(options.Client),
WithAuthorizer(NewAuthorizer(options.Client, func(string) (string, string, error) {
return "user1", "password1", nil
})),
WithAuthorizer(authorizer),
)
return base, options, close
}