We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c61a928 commit 43b9434Copy full SHA for 43b9434
2 files changed
examples/pull/main.go
@@ -25,6 +25,7 @@ func main() {
25
cli, err := client.NewWithOpts(
26
client.WithAuthProvider(override),
27
client.FromEnv,
28
+ client.WithVersionNegotiation,
29
client.WithDockerOpts(client2.WithTimeout(time.Hour*1)),
30
client.WithSugaredLogger(logger.With(zap.String("component", "docker-client"))),
31
)
pkg/client/client.go
@@ -46,6 +46,11 @@ func (c *Client) Close() error {
46
return c.Client.Close()
47
}
48
49
+func WithVersionNegotiation(c *Client) error {
50
+ c.dockerOpts = append(c.dockerOpts, client.WithAPIVersionNegotiation())
51
+ return nil
52
+}
53
+
54
func WithAuthProvider(authProvider auth.Provider) Opt {
55
return func(c *Client) error {
56
c.authProvider = authProvider
0 commit comments