From b238d4da032d652f41cf6b37eae971d354bea8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Thu, 11 Dec 2025 18:08:14 +0100 Subject: [PATCH] WithAPIVersionNegotiation enables automatic API version negotiation for the client. With this option enabled, the client automatically negotiates the API version to use when making requests. API version negotiation is performed on the first request; subsequent requests do not re-negotiate. #173. --- neko.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/neko.go b/neko.go index c8ef67d..c30ea0f 100644 --- a/neko.go +++ b/neko.go @@ -120,13 +120,16 @@ func (main *MainCtx) Preflight() { } func (main *MainCtx) Start() { - client, err := client.NewClientWithOpts(client.FromEnv) + client, err := client.NewClientWithOpts( + client.FromEnv, + client.WithAPIVersionNegotiation(), + ) if err != nil { main.logger.Panic().Err(err).Msg("unable to connect to docker client") } else { main.logger.Info(). Str("version", client.ClientVersion()). - Msg("successfully connected to docker client") + Msg("successfully connected to docker client (API negotiation enabled)") } main.roomManager = room.New(