mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
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:
@@ -120,13 +120,16 @@ func (main *MainCtx) Preflight() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (main *MainCtx) Start() {
|
func (main *MainCtx) Start() {
|
||||||
client, err := client.NewClientWithOpts(client.FromEnv)
|
client, err := client.NewClientWithOpts(
|
||||||
|
client.FromEnv,
|
||||||
|
client.WithAPIVersionNegotiation(),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
main.logger.Panic().Err(err).Msg("unable to connect to docker client")
|
main.logger.Panic().Err(err).Msg("unable to connect to docker client")
|
||||||
} else {
|
} else {
|
||||||
main.logger.Info().
|
main.logger.Info().
|
||||||
Str("version", client.ClientVersion()).
|
Str("version", client.ClientVersion()).
|
||||||
Msg("successfully connected to docker client")
|
Msg("successfully connected to docker client (API negotiation enabled)")
|
||||||
}
|
}
|
||||||
|
|
||||||
main.roomManager = room.New(
|
main.roomManager = room.New(
|
||||||
|
|||||||
Reference in New Issue
Block a user