-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates to the v1.40 upstream Docker API #25
Conversation
Just wondering: do you plan to support only the latest version of Docker API in this library? Because specifying an API version that is higher than of the server API version when making request effectively causes Docker daemon to return an error: https://github.com/moby/moby/blob/4e83c90ae8362a8205e3728e8fcb655a713a0d87/api/server/middleware/version.go#L58-L60 You can check this yourself by running:
Also see Idein/dockworker#51. |
Thanks for pointing that out - it does seem appropriate to have an environment variable, like the official docker client to toggle the API version. Is that something you would like to tackle in a separate PR ? |
I'm not sure if that'd be the right way to do tackle this, see the comment pointing to moby/moby#25498 here: gesellix/docker-client#25. |
It does seem like one would need to do something like: Although, I'm wondering whether it would just be easier to call the API without a version (like dockworker does). |
Added version negotiation in #27 . @edigaryev is that something you'd be happy with ? |
Yes, that works for me, thanks! |
…n API responses Recently Docker 19.03 was released and it introduced the new 1.40 API version with whole lot of new fields[1], which cause Bollard to fail due to it's use of deny_unknown_fields serde attribute. Quote from the Docker Engine API reference[2]: >The API uses an open schema model, which means server may add extra properties >to responses. >Likewise, the server will ignore any extra query parameters and request body >properties. >When you write clients, you need to ignore additional properties in responses >to ensure they do not break when talking to newer daemons. [1]: https://docs.docker.com/engine/api/version-history/#v140-api-changes [2]: https://docs.docker.com/engine/api/v1.39/#section/Versioning
18c5990
to
6621e8b
Compare
deny_unknown_fields
constraint (thanks @edigaryev )