[go: nahoru, domu]

Skip to content

Commit

Permalink
chore(*): Bumps krustlet to use the 2021 edition
Browse files Browse the repository at this point in the history
We've been tracking and using most of the latest features anyway, so
this seems to make sense

Signed-off-by: Taylor Thomas <taylor@oftaylor.com>
  • Loading branch information
thomastaylor312 committed Oct 21, 2021
1 parent 7b73f2e commit e588198
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ authors = [
default-run = "krustlet-wasi"
description = "A Kubernetes kubelet implementation in Rust, used for running WebAssembly modules in Kubernetes"
documentation = "https://github.com/deislabs/krustlet/tree/master/docs"
edition = "2018"
edition = "2021"
exclude = ["docs/*", "demos/*", ".github/*", ".gitignore"]
keywords = ["wasm", "wasi", "webassembly", "kubernetes"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/kubelet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = [
"Kevin Flansburg <kevin.flansburg@gmail.com>",
]
description = "A Kubernetes kubelet implementation in Rust"
edition = "2018"
edition = "2021"
keywords = [
"wasm",
"wasi",
Expand Down
2 changes: 1 addition & 1 deletion crates/oci-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = [
"Kevin Flansburg <kevin.flansburg@gmail.com>",
]
description = "An OCI implementation in Rust"
edition = "2018"
edition = "2021"
keywords = [
"oci",
"containers",
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
"Ryan Levick <rylevick@microsoft.com>",
"Kevin Flansburg <kevin.flansburg@gmail.com>",
]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
name = "wasi-provider"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion demos/wasi/hello-world-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "hello-world-rust"
version = "0.1.0"
authors = ["Taylor Thomas <taylor.thomas@microsoft.com>"]
edition = "2018"
edition = "2021"

[dependencies]

Expand Down
2 changes: 1 addition & 1 deletion demos/wasi/postman-echo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "postman-echo"
version = "0.1.0"
authors = ["Brian Hardock <brhardoc@microsoft.com>"]
edition = "2018"
edition = "2021"

[dependencies]
wasi-experimental-http = "0.5.0"
Expand Down
2 changes: 1 addition & 1 deletion demos/wasi/simpleserver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "simpleserver"
version = "0.1.0"
authors = ["Matt Butcher <matt.butcher@microsoft.com>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion demos/wasi/wasmerciser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "wasmerciser"
version = "0.3.0"
authors = ["itowlson <ivan.towlson@microsoft.com>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 4 additions & 2 deletions tests/assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub async fn pod_exited_successfully(pods: &Api<Pod>, pod_name: &str) -> anyhow:
let pod = pods.get(pod_name).await?;

let state = (|| {
let _ = &pod;
pod.status?.container_statuses?[0]
.state
.as_ref()?
Expand All @@ -73,7 +74,7 @@ pub async fn pod_exited_successfully(pods: &Api<Pod>, pod_name: &str) -> anyhow:
pub async fn pod_exited_with_failure(pods: &Api<Pod>, pod_name: &str) -> anyhow::Result<()> {
let pod = pods.get(pod_name).await?;

let phase = (|| pod.status?.phase)().expect("Could not get pod phase");
let phase = (|| { let _ = &pod; pod.status?.phase })().expect("Could not get pod phase");
assert_eq!(phase, "Failed");

Ok(())
Expand All @@ -86,7 +87,7 @@ pub async fn pod_reason_contains(
) -> anyhow::Result<()> {
let pod = pods.get(pod_name).await?;

let message = (|| pod.status?.reason)().expect("Could not get pod message.");
let message = (|| { let _ = &pod; pod.status?.reason })().expect("Could not get pod message.");
assert!(
message.contains(expected_message),
"Expected pod message containing {} but got {}",
Expand All @@ -104,6 +105,7 @@ pub async fn main_container_exited_with_failure(
let pod = pods.get(pod_name).await?;

let state = (|| {
let _ = &pod;
pod.status?.container_statuses?[0]
.state
.as_ref()?
Expand Down

0 comments on commit e588198

Please sign in to comment.