Skip to content

Commit

Permalink
Merge pull request #476 from fussybeaver/ND/sync-api-v1.47
Browse files Browse the repository at this point in the history
Sync Bollard to api v1.46
  • Loading branch information
fussybeaver authored Nov 13, 2024
2 parents 9f923c2 + bb1e9fb commit c864985
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pipe = ["hyperlocal", "hyper-named-pipe"]

[dependencies]
base64 = "0.22"
bollard-stubs = { version = "=1.45.0-rc.26.0.1", default-features = false }
bollard-stubs = { version = "=1.46.0-rc.27.3.1", default-features = false }
bollard-buildkit-proto = { path = "codegen/proto", version = "=0.4.0", optional = true }
bytes = "1"
chrono = { version = "0.4", default-features = false, features = ["std", "clock", "serde"], optional = true }
Expand Down
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,10 @@ encouraged.

### Version

The [Docker API](https://docs.docker.com/engine/api/v1.44/) used by Bollard is using the latest
`1.44` documentation schema published by the [moby](https://github.com/moby/moby) project to
The [Docker API](https://docs.docker.com/engine/api/v1.46/) used by Bollard is using the latest
`1.46` documentation schema published by the [moby](https://github.com/moby/moby) project to
generate its serialization interface.

Breaking change releases in Bollard will depend on a moby API server version corresponding to the
date of that release, so for example a January minor version change will use the
matching [moby swagger API](https://github.com/moby/moby/blob/master/api/swagger.yaml)
available in January. The associated [`bollard-stubs`](https://crates.io/crate/bollard-stubs)
project will release separate versions that you can pin your project against, if you need a
more modern or older API according to your docker server version.

For example:
```nocompile
[dependencies]
bollard-stubs = { version = "=1.44.0-rc.26.0.0" }
```

This library also supports [version
negotiation](https://docs.rs/bollard/latest/bollard/struct.Docker.html#method.negotiate_version),
to allow downgrading to an older API version.
Expand Down
30 changes: 1 addition & 29 deletions codegen/swagger/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1 @@
## Overview

This data model was generated by the [swagger-codegen]
(https://github.com/swagger-api/swagger-codegen) project.

To see how to make this your own, look here:

[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)

- API version: 1.47.0-rc.27.3.1
- Code generation suffix: 1.47.0-rc.27.3.1
- Build date: 2024-11-12T11:52:28.377Z

This autogenerated project defines an API crate `bollard-stubs` which contains:
* Data types representing the underlying data model.

The data types are generated specifically for the [Bollard API client](https://github.com/fussybeaver/bollard), and are not intended for direct library consumption. These data stubs might change as needed by the parent project.

## Package versioning

The upstream Docker API version references the major and minor version of this package. An additional suffix constitutes revisions around the code generator.

## Generating code.

Use the java package manager maven to generate the stubs. Java JDK 8 is required to run these:

```bash
mvn -D org.slf4j.simpleLogger.defaultLogLevel=debug clean compiler:compile generate-resources
```
License: Apache-2.0
2 changes: 1 addition & 1 deletion src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const DEFAULT_TIMEOUT: u64 = 120;
/// Default Client Version to communicate with the server.
pub const API_DEFAULT_VERSION: &ClientVersion = &ClientVersion {
major_version: 1,
minor_version: 45,
minor_version: 47,
};

#[derive(Debug, Clone)]
Expand Down
17 changes: 2 additions & 15 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,10 @@
//!
//! ## Version
//!
//! The [Docker API](https://docs.docker.com/engine/api/v1.44/) used by Bollard is using the latest
//! `1.44` documentation schema published by the [moby](https://github.com/moby/moby) project to
//! The [Docker API](https://docs.docker.com/engine/api/v1.46/) used by Bollard is using the latest
//! `1.46` documentation schema published by the [moby](https://github.com/moby/moby) project to
//! generate its serialization interface.
//!
//! Breaking change releases in Bollard will depend on a moby API server version corresponding to the
//! date of that release, so for example a January minor version change will use the
//! matching [moby swagger API](https://github.com/moby/moby/blob/master/api/swagger.yaml)
//! available in January. The associated [`bollard-stubs`](https://crates.io/crate/bollard-stubs)
//! project will release separate versions that you can pin your project against, if you need a
//! more modern or older API according to your docker server version.
//!
//! For example:
//! ```nocompile
//! [dependencies]
//! bollard-stubs = { version = "=1.44.0-rc.26.0.0" }
//! ```
//!
//! This library also supports [version
//! negotiation](https://docs.rs/bollard/latest/bollard/struct.Docker.html#method.negotiate_version),
//! to allow downgrading to an older API version.
Expand Down
9 changes: 6 additions & 3 deletions tests/network_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async fn create_network_test(docker: Docker) -> Result<(), Error> {
let result = &docker.create_network(create_network_options).await?;
let result = &docker
.inspect_network(
result.id.as_ref().unwrap(),
<String as AsRef<str>>::as_ref(&result.id),
Some(InspectNetworkOptions::<&str> {
verbose: true,
..Default::default()
Expand Down Expand Up @@ -153,10 +153,13 @@ async fn connect_network_test(docker: Docker) -> Result<(), Error> {
let result = &docker.create_network(create_network_options).await?;

let _ = &docker
.connect_network(result.id.as_ref().unwrap(), connect_network_options)
.connect_network(
<String as AsRef<str>>::as_ref(&result.id),
connect_network_options,
)
.await?;

let id = result.id.as_ref().unwrap();
let id = <String as AsRef<str>>::as_ref(&result.id);

let result = &docker
.inspect_network(
Expand Down

0 comments on commit c864985

Please sign in to comment.