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.

This commit is contained in:
Miroslav Šedivý
2025-12-11 18:08:14 +01:00
parent d59605ff9a
commit b238d4da03
+5 -2
View File
@@ -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(