Skip to content

Commit

Permalink
Merge pull request #96 from krustlet/dependabot/cargo/testcontainers-…
Browse files Browse the repository at this point in the history
…0.15

chore(deps): Update testcontainers requirement from 0.14 to 0.15
  • Loading branch information
flavio authored Oct 24, 2023
2 parents 5ff26dc + 639c73d commit 26069b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ docker_credential = "1.0"
hmac = "0.12"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tempfile = "3.3"
testcontainers = "0.14"
testcontainers = "0.15"
tokio = { version = "1.21", features = ["macros", "fs", "rt-multi-thread"] }
tokio-util = { version = "0.7.4", features = ["compat"] }
20 changes: 8 additions & 12 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,13 @@ impl Client {
}

let request = self.client.get(&url);
let request = if n.is_some() {
request.query(&[("n", n.unwrap())])
let request = if let Some(num) = n {
request.query(&[("n", num)])
} else {
request
};
let request = if last.is_some() {
request.query(&[("last", last.unwrap())])
let request = if let Some(l) = last {
request.query(&[("last", l)])
} else {
request
};
Expand Down Expand Up @@ -1651,11 +1651,7 @@ mod test {
use tokio_util::io::StreamReader;

#[cfg(feature = "test-registry")]
use testcontainers::{
clients,
core::WaitFor,
images::{self, generic::GenericImage},
};
use testcontainers::{clients, core::WaitFor, GenericImage};

const HELLO_IMAGE_NO_TAG: &str = "webassembly.azurecr.io/hello-wasm";
const HELLO_IMAGE_TAG: &str = "webassembly.azurecr.io/hello-wasm:v1";
Expand Down Expand Up @@ -2362,19 +2358,19 @@ mod test {
// We require this fix only when testing the capability to list tags
#[cfg(feature = "test-registry")]
fn registry_image_edge() -> GenericImage {
images::generic::GenericImage::new("distribution/distribution", "edge")
GenericImage::new("distribution/distribution", "edge")
.with_wait_for(WaitFor::message_on_stderr("listening on "))
}

#[cfg(feature = "test-registry")]
fn registry_image() -> GenericImage {
images::generic::GenericImage::new("docker.io/library/registry", "2")
GenericImage::new("docker.io/library/registry", "2")
.with_wait_for(WaitFor::message_on_stderr("listening on "))
}

#[cfg(feature = "test-registry")]
fn registry_image_basic_auth(auth_path: &str) -> GenericImage {
images::generic::GenericImage::new("docker.io/library/registry", "2")
GenericImage::new("docker.io/library/registry", "2")
.with_env_var("REGISTRY_AUTH", "htpasswd")
.with_env_var("REGISTRY_AUTH_HTPASSWD_REALM", "Registry Realm")
.with_env_var("REGISTRY_AUTH_HTPASSWD_PATH", "/auth/htpasswd")
Expand Down

0 comments on commit 26069b3

Please sign in to comment.