File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ func main() {
2525 cli , err := client .NewWithOpts (
2626 client .WithAuthProvider (override ),
2727 client .FromEnv ,
28+ client .WithVersionNegotiation ,
2829 client .WithDockerOpts (client2 .WithTimeout (time .Hour * 1 )),
2930 client .WithSugaredLogger (logger .With (zap .String ("component" , "docker-client" ))),
3031 )
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ func (c *Client) Close() error {
4646 return c .Client .Close ()
4747}
4848
49+ func WithVersionNegotiation (c * Client ) error {
50+ c .dockerOpts = append (c .dockerOpts , client .WithAPIVersionNegotiation ())
51+ return nil
52+ }
53+
4954func WithAuthProvider (authProvider auth.Provider ) Opt {
5055 return func (c * Client ) error {
5156 c .authProvider = authProvider
You can’t perform that action at this time.
0 commit comments