Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance-tests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl SpinShim {
ctr_run_id: &str,
) -> anyhow::Result<Self> {
let port = get_available_port().context("no available port")?;
let listen_adress_env = format!("SPIN_HTTP_LISTEN_ADDR=0.0.0.0:{}", port);
let listen_adress_env = format!("SPIN_HTTP_LISTEN_ADDR=0.0.0.0:{port}");
let mut ctr_cmd = std::process::Command::new(ctr_binary_path);
let child = ctr_cmd
.arg("run")
Expand Down
4 changes: 2 additions & 2 deletions containerd-shim-spin/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ impl Sandbox for SpinSandbox {
Ok(0)
}
Ok(Err(err)) => {
log::error!("run_wasi ERROR >>> failed: {:?}", err);
log::error!("run_wasi ERROR >>> failed: {err:?}");
Err(err)
}
Err(aborted) => {
info!("Received signal to abort: {:?}", aborted);
info!("Received signal to abort: {aborted:?}");
Ok(0)
}
}
Expand Down
2 changes: 1 addition & 1 deletion containerd-shim-spin/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Source {
if name == spin_oci::client::SPIN_APPLICATION_MEDIA_TYPE =>
{
let path = PathBuf::from("/spin.json");
log::info!("writing spin oci config to {:?}", path);
log::info!("writing spin oci config to {path:?}");
File::create(&path)
.context("failed to create spin.json")?
.write_all(&artifact.layer)
Expand Down
2 changes: 1 addition & 1 deletion containerd-shim-spin/src/trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ where
let builder: TriggerAppBuilder<_, FactorsBuilder> = TriggerAppBuilder::new(trigger);
let builder_args = match std::env::var("SPIN_MAX_INSTANCE_MEMORY") {
Ok(limit) => {
debug!("Setting instance max memory to {} bytes", limit);
debug!("Setting instance max memory to {limit} bytes");
let mut args = TriggerAppArgs::default();
args.max_instance_memory = limit.parse().ok();
args
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.86.0"
channel = "1.88.0"
components = ["clippy", "rustfmt"]
targets = ["wasm32-wasip1", "wasm32-unknown-unknown"]
profile = "default"
44 changes: 16 additions & 28 deletions tests/src/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ mod test {
// verify res is ok and not 404
match res {
Ok(_) => {
println!("response_code: {}", response_code);
println!("response_code: {response_code}");
if response_code / 100 == 2 {
break; // 2xx response
}
}
Err(e) => {
println!("res: {}, response_code: {}", e, response_code);
println!("res: {e}, response_code: {response_code}");
}
}
i += 1;
Expand All @@ -55,9 +55,9 @@ mod test {
let host_port = 8082;

// curl for hello
println!(" >>> curl http://localhost:{}/spin/hello", host_port);
println!(" >>> curl http://localhost:{host_port}/spin/hello");
let res = retry_get(
&format!("http://localhost:{}/spin/hello", host_port),
&format!("http://localhost:{host_port}/spin/hello"),
RETRY_TIMES,
INTERVAL_IN_SECS,
)
Expand All @@ -72,9 +72,9 @@ mod test {
let host_port = 8082;

// curl for hello
println!(" >>> curl http://localhost:{}/keyvalue/keyvalue", host_port);
println!(" >>> curl http://localhost:{host_port}/keyvalue/keyvalue");
let res = retry_get(
&format!("http://localhost:{}/keyvalue/keyvalue", host_port),
&format!("http://localhost:{host_port}/keyvalue/keyvalue"),
RETRY_TIMES,
INTERVAL_IN_SECS,
)
Expand All @@ -96,16 +96,13 @@ mod test {

let forward_port = port_forward_svc(redis_port, "redis").await?;

let client = redis::Client::open(format!("redis://localhost:{}", forward_port))?;
let client = redis::Client::open(format!("redis://localhost:{forward_port}"))?;
let mut con = client.get_multiplexed_async_connection().await?;

// curl for hello
println!(
" >>> curl http://localhost:{}/outboundredis/hello",
host_port
);
println!(" >>> curl http://localhost:{host_port}/outboundredis/hello");
let _ = retry_get(
&format!("http://localhost:{}/outboundredis/hello", host_port),
&format!("http://localhost:{host_port}/outboundredis/hello"),
RETRY_TIMES,
INTERVAL_IN_SECS,
)
Expand All @@ -126,9 +123,9 @@ mod test {
let host_port = 8082;

// curl for hello
println!(" >>> curl http://localhost:{}/multi-trigger-app", host_port);
println!(" >>> curl http://localhost:{host_port}/multi-trigger-app");
let res = retry_get(
&format!("http://localhost:{}/multi-trigger-app", host_port),
&format!("http://localhost:{host_port}/multi-trigger-app"),
RETRY_TIMES,
INTERVAL_IN_SECS,
)
Expand All @@ -147,7 +144,7 @@ mod test {

let forward_port = port_forward_svc(redis_port, "redis").await?;

let client = redis::Client::open(format!("redis://localhost:{}", forward_port))
let client = redis::Client::open(format!("redis://localhost:{forward_port}"))
.context("connecting to redis")?;
let mut con = client.get_multiplexed_async_connection().await?;

Expand Down Expand Up @@ -225,15 +222,9 @@ mod test {
let host_port = 8082;

// curl for static asset
println!(
" >>> curl http://localhost:{}/static-assets/jabberwocky.txt",
host_port
);
println!(" >>> curl http://localhost:{host_port}/static-assets/jabberwocky.txt");
let res = retry_get(
&format!(
"http://localhost:{}/static-assets/jabberwocky.txt",
host_port
),
&format!("http://localhost:{host_port}/static-assets/jabberwocky.txt"),
RETRY_TIMES,
INTERVAL_IN_SECS,
)
Expand All @@ -260,15 +251,12 @@ mod test {
async fn port_forward_svc(svc_port: u16, svc_name: &str) -> Result<u16> {
let port = get_random_port()?;

println!(
" >>> kubectl portforward svc {} {}:{} ",
svc_name, port, svc_port
);
println!(" >>> kubectl portforward svc {svc_name} {port}:{svc_port} ");

Command::new("kubectl")
.arg("port-forward")
.arg(svc_name)
.arg(format!("{}:{}", port, svc_port))
.arg(format!("{port}:{svc_port}"))
.spawn()?;
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
Ok(port)
Expand Down
Loading