@@ -13,7 +13,7 @@ import (
13
13
"golang.org/x/xerrors"
14
14
)
15
15
16
- type DockerClient interface {
16
+ type Client interface {
17
17
dockerclient.SystemAPIClient
18
18
dockerclient.ContainerAPIClient
19
19
dockerclient.ImageAPIClient
@@ -23,13 +23,13 @@ type clientKey struct{}
23
23
24
24
// WithClient sets the provided DockerClient on the context.
25
25
// It should only be used for tests.
26
- func WithClient (ctx context.Context , client DockerClient ) context.Context {
26
+ func WithClient (ctx context.Context , client Client ) context.Context {
27
27
return context .WithValue (ctx , clientKey {}, client )
28
28
}
29
29
30
- // Client returns the DockerClient set on the context. If one can't be
30
+ // ExtractClient returns the DockerClient set on the context. If one can't be
31
31
// found a default client is returned.
32
- func Client (ctx context.Context ) (DockerClient , error ) {
32
+ func ExtractClient (ctx context.Context ) (Client , error ) {
33
33
client := ctx .Value (clientKey {})
34
34
if client == nil {
35
35
client , err := dockerclient .NewClientWithOpts (dockerclient .FromEnv )
@@ -41,7 +41,7 @@ func Client(ctx context.Context) (DockerClient, error) {
41
41
}
42
42
43
43
//nolint we should panic if this isn't the case.
44
- return client .(DockerClient ), nil
44
+ return client .(Client ), nil
45
45
}
46
46
47
47
type AuthConfig registry.AuthConfig
0 commit comments