diff --git a/.circleci/config.yml b/.circleci/config.yml index 989e9823..832dca83 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2 jobs: test_ssl: docker: - - image: docker:20.10.11 + - image: docker:20.10.16 steps: - checkout - setup_remote_docker @@ -15,7 +15,7 @@ jobs: - run: docker run -ti -e DOCKER_CERT_PATH=/certs -e DOCKER_HOST='tcp://test.example.com:2376' --volumes-from certs --rm --link test-docker-daemon:docker bollard cargo test --features test_ssl,ct_logs -- --test test_version_ssl test_http: docker: - - image: docker:20.10.11 + - image: docker:20.10.16 steps: - checkout - setup_remote_docker @@ -24,7 +24,7 @@ jobs: - run: docker run -ti -e DOCKER_HOST='tcp://test.example.com:2375' --rm --link test-docker-daemon:docker bollard cargo test --features test_http -- --test test_version_http test_unix: docker: - - image: docker:20.10.11 + - image: docker:20.10.16 steps: - checkout - setup_remote_docker @@ -32,7 +32,7 @@ jobs: - run: dockerfiles/bin/run_integration_tests.sh test_doc: docker: - - image: docker:20.10.11 + - image: docker:20.10.16 steps: - checkout - setup_remote_docker @@ -40,7 +40,7 @@ jobs: - run: docker run -ti --rm bollard cargo test --target x86_64-unknown-linux-gnu --doc test_clippy: docker: - - image: docker:20.10.11 + - image: docker:20.10.16 steps: - checkout - setup_remote_docker @@ -48,7 +48,7 @@ jobs: - run: docker run -ti --rm bollard bash -c "rustup component add clippy && cargo clippy --all-targets -- -Dwarnings -Aclippy::upper_case_acronyms" test_audit: docker: - - image: docker:20.10.11 + - image: docker:20.10.16 steps: - checkout - setup_remote_docker @@ -57,7 +57,7 @@ jobs: - run: docker run -ti --rm bollard bash -c "cargo install cargo-audit && cargo audit --deny warnings --ignore=RUSTSEC-2020-0159 --ignore=RUSTSEC-2020-0071" test_fmt: docker: - - image: docker:20.10.11 + - image: docker:20.10.16 steps: - checkout - setup_remote_docker diff --git a/Cargo.toml b/Cargo.toml index f3ab1bf5..dd1ef330 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ ct_logs = ["ssl", "ct-logs"] [dependencies] base64 = "0.13" -bollard-stubs = { version = "=1.42.0-rc.0" } +bollard-stubs = { version = "=1.42.0-rc.2" } bytes = "1" chrono = { version = "0.4", features = ["serde"] } ct-logs = { version = "0.9.0", optional = true } diff --git a/codegen/pom.xml b/codegen/pom.xml index 8c74509b..6c73d3e2 100644 --- a/codegen/pom.xml +++ b/codegen/pom.xml @@ -12,17 +12,18 @@ io.swagger swagger-codegen-maven-plugin - 2.4.26 + 2.4.27 generate - - https://raw.githubusercontent.com/moby/moby/master/docs/api/v1.41.yaml + https://raw.githubusercontent.com/moby/moby/a06bae909494b43daadc0ee60dbce79231616470/docs/api/v1.41.yaml bollard.BollardCodegen ${project.build.directory}/generated-sources true @@ -30,7 +31,7 @@ models.rs,lib.rs,Cargo.toml,config,README.md bollard-stubs - 1.42.0-rc.0 + 1.42.0-rc.2 @@ -55,7 +56,7 @@ io.swagger swagger-codegen - 2.4.26 + 2.4.27 diff --git a/codegen/target/generated-sources/.swagger-codegen/VERSION b/codegen/target/generated-sources/.swagger-codegen/VERSION index 21f40d97..d32233fe 100644 --- a/codegen/target/generated-sources/.swagger-codegen/VERSION +++ b/codegen/target/generated-sources/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.26 \ No newline at end of file +2.4.27 \ No newline at end of file diff --git a/codegen/target/generated-sources/Cargo.toml b/codegen/target/generated-sources/Cargo.toml index c5a69383..099feabd 100644 --- a/codegen/target/generated-sources/Cargo.toml +++ b/codegen/target/generated-sources/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bollard-stubs" -version = "1.42.0-rc.0" +version = "1.42.0-rc.2" authors = [ "Bollard contributors" ] description = "Stubs used for the Bollard rust async Docker client API" license = "Apache-2.0" diff --git a/codegen/target/generated-sources/README.md b/codegen/target/generated-sources/README.md index 821a5c6a..418bbcb1 100644 --- a/codegen/target/generated-sources/README.md +++ b/codegen/target/generated-sources/README.md @@ -7,9 +7,9 @@ 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.42.0-rc.0 -- Code generation suffix: 1.42.0-rc.0 -- Build date: 2022-03-23T16:54:11.696Z +- API version: 1.42.0-rc.2 +- Code generation suffix: 1.42.0-rc.2 +- Build date: 2022-05-31T18:04:02.348+01:00 This autogenerated project defines an API crate `bollard-stubs` which contains: * Data types representing the underlying data model. diff --git a/codegen/target/generated-sources/src/models.rs b/codegen/target/generated-sources/src/models.rs index 72cbf10c..ecf128b6 100644 --- a/codegen/target/generated-sources/src/models.rs +++ b/codegen/target/generated-sources/src/models.rs @@ -284,7 +284,7 @@ pub struct ContainerChangeResponseItem { } -/// Configuration for a container that is portable between hosts. +/// Configuration for a container that is portable between hosts. When used as `ContainerConfig` field in an image, `ContainerConfig` is an optional field containing the configuration of the container that was last committed when creating the image. Previous versions of Docker builder used this field to store build cache, and it is not in active use anymore. #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] pub struct ContainerConfig { /// The hostname to use for the container, as a valid RFC 1123 hostname. @@ -801,6 +801,16 @@ pub struct ContainerUpdateResponse { } +/// container waiting error, if any +#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +pub struct ContainerWaitExitError { + /// Details of an error + #[serde(rename = "Message")] + #[serde(skip_serializing_if="Option::is_none")] + pub message: Option, + +} + /// OK response to ContainerWait operation #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] pub struct ContainerWaitResponse { @@ -810,17 +820,7 @@ pub struct ContainerWaitResponse { #[serde(rename = "Error")] #[serde(skip_serializing_if="Option::is_none")] - pub error: Option, - -} - -/// container waiting error, if any -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] -pub struct ContainerWaitResponseError { - /// Details of an error - #[serde(rename = "Message")] - #[serde(skip_serializing_if="Option::is_none")] - pub message: Option, + pub error: Option, } @@ -2028,7 +2028,7 @@ pub struct HostConfig { #[serde(skip_serializing_if="Option::is_none")] pub readonly_rootfs: Option, - /// A list of string values to customize labels for MLS systems, such as SELinux. + /// A list of string values to customize labels for MLS systems, such as SELinux. #[serde(rename = "SecurityOpt")] #[serde(skip_serializing_if="Option::is_none")] pub security_opt: Option>, @@ -2056,7 +2056,7 @@ pub struct HostConfig { /// Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. #[serde(rename = "ShmSize")] #[serde(skip_serializing_if="Option::is_none")] - pub shm_size: Option, + pub shm_size: Option, /// A list of kernel parameters (sysctls) to set in the container. For example: ``` {\"net.ipv4.ip_forward\": \"1\"} ``` #[serde(rename = "Sysctls")] @@ -2231,12 +2231,12 @@ pub struct ImageId { /// Information about an image in the local image cache. #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] pub struct ImageInspect { - /// ID is the content-addressable ID of an image. This identified is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image). Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. + /// ID is the content-addressable ID of an image. This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image). Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. #[serde(rename = "Id")] #[serde(skip_serializing_if="Option::is_none")] pub id: Option, - /// List of image names/tags in the local image cache that reference this image. Multiple image tags can refer to the same imagem and this list may be empty if no tags reference the image, in which case the image is \"untagged\", in which case it can still be referenced by its ID. + /// List of image names/tags in the local image cache that reference this image. Multiple image tags can refer to the same image, and this list may be empty if no tags reference the image, in which case the image is \"untagged\", in which case it can still be referenced by its ID. #[serde(rename = "RepoTags")] #[serde(skip_serializing_if="Option::is_none")] pub repo_tags: Option>, @@ -2390,36 +2390,46 @@ pub struct ImageSearchResponseItem { #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] pub struct ImageSummary { + /// ID is the content-addressable ID of an image. This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image). Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. #[serde(rename = "Id")] pub id: String, + /// ID of the parent image. Depending on how the image was created, this field may be empty and is only set for images that were built/created locally. This field is empty if the image was pulled from an image registry. #[serde(rename = "ParentId")] pub parent_id: String, + /// List of image names/tags in the local image cache that reference this image. Multiple image tags can refer to the same image, and this list may be empty if no tags reference the image, in which case the image is \"untagged\", in which case it can still be referenced by its ID. #[serde(rename = "RepoTags")] #[serde(deserialize_with = "deserialize_nonoptional_vec")] pub repo_tags: Vec, + /// List of content-addressable digests of locally available image manifests that the image is referenced from. Multiple manifests can refer to the same image. These digests are usually only available if the image was either pulled from a registry, or if the image was pushed to a registry, which is when the manifest is generated and its digest calculated. #[serde(rename = "RepoDigests")] #[serde(deserialize_with = "deserialize_nonoptional_vec")] pub repo_digests: Vec, + /// Date and time at which the image was created as a Unix timestamp (number of seconds sinds EPOCH). #[serde(rename = "Created")] pub created: i64, + /// Total size of the image including all layers it is composed of. #[serde(rename = "Size")] pub size: i64, + /// Total size of image layers that are shared between this image and other images. This size is not calculated by default. `-1` indicates that the value has not been set / calculated. #[serde(rename = "SharedSize")] pub shared_size: i64, + /// Total size of the image including all layers it is composed of. In versions of Docker before v1.10, this field was calculated from the image itself and all of its parent images. Docker v1.10 and up store images self-contained, and no longer use a parent-chain, making this field an equivalent of the Size field. This field is kept for backward compatibility, but may be removed in a future version of the API. #[serde(rename = "VirtualSize")] pub virtual_size: i64, + /// User-defined key/value metadata. #[serde(rename = "Labels")] #[serde(deserialize_with = "deserialize_nonoptional_map")] pub labels: HashMap, + /// Number of containers using this image. Includes both stopped and running containers. This size is not calculated by default, and depends on which API endpoint is used. `-1` indicates that the value has not been set / calculated. #[serde(rename = "Containers")] pub containers: i64, @@ -6565,9 +6575,9 @@ pub struct TaskSpecResources { pub limits: Option, /// Define resources reservation. - #[serde(rename = "Reservation")] + #[serde(rename = "Reservations")] #[serde(skip_serializing_if="Option::is_none")] - pub reservation: Option, + pub reservations: Option, } @@ -6905,7 +6915,7 @@ impl ::std::convert::AsRef for VolumeScopeEnum { /// Volume configuration #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] -pub struct VolumeConfig { +pub struct VolumeCreateOptions { /// The new volume's name. If not specified, Docker generates a name. #[serde(rename = "Name")] #[serde(skip_serializing_if="Option::is_none")] @@ -6933,13 +6943,13 @@ pub struct VolumeConfig { pub struct VolumeListResponse { /// List of volumes #[serde(rename = "Volumes")] - #[serde(deserialize_with = "deserialize_nonoptional_vec")] - pub volumes: Vec, + #[serde(skip_serializing_if="Option::is_none")] + pub volumes: Option>, /// Warnings that occurred when fetching the list of volumes. #[serde(rename = "Warnings")] - #[serde(deserialize_with = "deserialize_nonoptional_vec")] - pub warnings: Vec, + #[serde(skip_serializing_if="Option::is_none")] + pub warnings: Option>, } diff --git a/tests/volume_test.rs b/tests/volume_test.rs index 68795089..ef898261 100644 --- a/tests/volume_test.rs +++ b/tests/volume_test.rs @@ -35,8 +35,11 @@ async fn list_volumes_test(docker: Docker) -> Result<(), Error> { })) .await?; - assert_eq!(results.volumes.len(), 1); - assert_eq!(results.volumes[0].name, "integration_test_list_volumes"); + assert_eq!(results.volumes.as_ref().unwrap().len(), 1); + assert_eq!( + results.volumes.as_ref().unwrap()[0].name, + "integration_test_list_volumes" + ); let remove_volume_options = RemoveVolumeOptions { force: true }; let _ = &docker @@ -124,7 +127,7 @@ async fn prune_volumes_test(docker: Docker) -> Result<(), Error> { })) .await?; - assert_eq!(results.volumes.len(), 0); + assert_eq!(results.volumes, None); let mut list_volumes_filters = HashMap::new(); list_volumes_filters.insert("label", vec!["maintainer=bollard-maintainer"]); @@ -135,8 +138,11 @@ async fn prune_volumes_test(docker: Docker) -> Result<(), Error> { })) .await?; - assert_eq!(results.volumes.len(), 1); - assert_eq!(results.volumes[0].name, "integration_test_prune_volumes_2"); + assert_eq!(results.volumes.as_ref().unwrap().len(), 1); + assert_eq!( + results.volumes.as_ref().unwrap()[0].name, + "integration_test_prune_volumes_2" + ); let results = &docker.list_volumes::(None).await?; @@ -146,13 +152,15 @@ async fn prune_volumes_test(docker: Docker) -> Result<(), Error> { String::from("bollard-maintainer"), ); - assert_ne!(0, results.volumes.len()); + assert_ne!(0, results.volumes.as_ref().unwrap().len()); // we need to filter the results, because volumes without a label are not pruned assert_eq!( &expected_results_label, &results .volumes + .as_ref() + .unwrap() .iter() .find(|v| !v.labels.is_empty()) .unwrap()