From 4b6f4479c8af08fb9eea2905dc3a4aadd12b81ca Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Wed, 29 Jan 2025 19:53:54 +0000 Subject: [PATCH] chore: bump the containerd-shim-wasm to 0.9.0 Signed-off-by: Jiaxiao (mossaka) Zhou --- CHANGELOG.md | 4 + Cargo.lock | 236 +++++++++++++++++------------ containerd-shim-spin/Cargo.toml | 5 +- containerd-shim-spin/src/engine.rs | 25 ++- containerd-shim-spin/src/main.rs | 2 +- containerd-shim-spin/src/utils.rs | 14 +- 6 files changed, 178 insertions(+), 108 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cf834c4..72f432ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ## [Unreleased] +### Change + +- Bump containerd-shim-wasm to v0.9.0 ([#271](https://github.com/spinkube/containerd-shim-spin/pull/271)). To see the changes in the containerd-shim-wasm, please refer to the [containerd-shim-wasm changelog](https://github.com/containerd/runwasi/blob/containerd-shim-wasm/v0.9.0/crates/containerd-shim-wasm/CHANGELOG.md). + ## [v0.18.0] - 2025-01-14 ### Changed diff --git a/Cargo.lock b/Cargo.lock index 16be6ac3..66b09f5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -142,9 +142,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "arbitrary" @@ -1788,9 +1788,9 @@ dependencies = [ [[package]] name = "containerd-shim" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7db624a85172d3d66c8408e8a7ec8519b6506cc7437947c31ec3730dfd8b05" +checksum = "6a6ddc50d113188cb707839b8670faabdbab39c052846e2430ea8d47d893b18d" dependencies = [ "cgroups-rs", "command-fds", @@ -1801,23 +1801,25 @@ dependencies = [ "log", "mio", "nix 0.29.0", - "oci-spec 0.6.8", + "oci-spec", "os_pipe", "page_size", "prctl", "serde", "serde_json", + "sha2", "signal-hook", - "thiserror 1.0.69", + "thiserror 2.0.11", "time", + "which 7.0.1", "windows-sys 0.52.0", ] [[package]] name = "containerd-shim-protos" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11496b458083e0e6c6f7a3473b33bb2af0f1ab6a39cdaf9f1bb1f6044f43bc51" +checksum = "fb8db604974f81d1e350d30f274872f43b45e79203ebb8b1ff714e7b18d24e81" dependencies = [ "protobuf 3.2.0", "ttrpc", @@ -1840,13 +1842,12 @@ name = "containerd-shim-spin-v2" version = "0.18.0" dependencies = [ "anyhow", - "containerd-shim", "containerd-shim-wasm", "ctrlc", "futures", "http 1.2.0", "log", - "oci-spec 0.6.8", + "oci-spec", "openssl", "serde", "serde_json", @@ -1880,16 +1881,15 @@ dependencies = [ [[package]] name = "containerd-shim-wasm" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00030bfeb9783ed94665bda2c2a597d7c77730fb3e0959b451fa82618f83be6" +checksum = "a6f71780ae9c43d9e0b9a8875016c0a0c9d3915eb3f2e1e27720e1ba660eab09" dependencies = [ "anyhow", "caps", "chrono", "containerd-client", "containerd-shim", - "crossbeam", "dbus", "futures", "git-version", @@ -1897,17 +1897,20 @@ dependencies = [ "libcontainer", "log", "nix 0.29.0", - "oci-spec 0.6.8", + "oci-spec", "protobuf 3.2.0", "serde", + "serde_bytes", "serde_json", "sha256", - "thiserror 1.0.69", + "thiserror 2.0.11", "tokio", "tokio-stream", - "wasmparser 0.220.0", + "ttrpc-codegen", + "wasmparser 0.223.0", "wat", "windows-sys 0.59.0", + "zygote", ] [[package]] @@ -2680,6 +2683,12 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "env_home" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" + [[package]] name = "equivalent" version = "1.0.1" @@ -2942,7 +2951,6 @@ dependencies = [ "futures-core", "futures-task", "futures-util", - "num_cpus", ] [[package]] @@ -3234,6 +3242,7 @@ dependencies = [ "allocator-api2", "equivalent", "foldhash", + "serde", ] [[package]] @@ -4031,52 +4040,49 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libcgroups" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6c844cd81f0e078bb07896a14fddcec9f9582833ce18f99c2d4c9b69081d53" +checksum = "a2c44a1aff9c0ae6809dab6a76ec99532d144951031ed07234d086a182e1091d" dependencies = [ "fixedbitset 0.5.7", "nix 0.28.0", - "oci-spec 0.6.8", + "oci-spec", "procfs", "serde", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "libcontainer" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e301f76db45c6b2612de0fb1978b9e245fd64a36898ff35928760aee7e34af70" +checksum = "cc6e2341245085c207d932c6bcf74e14676fb90f4386f88d239bf9d96678c787" dependencies = [ - "bitflags 2.6.0", "caps", "chrono", "fastrand 2.3.0", - "futures", "libc", "libcgroups", "libseccomp", "nc", "nix 0.28.0", - "oci-spec 0.6.8", + "oci-spec", "once_cell", "prctl", "procfs", - "protobuf 3.2.0", "regex", "rust-criu", "safe-path", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] @@ -4281,9 +4287,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" dependencies = [ "value-bag", ] @@ -4794,7 +4800,7 @@ dependencies = [ "http-auth", "jwt", "lazy_static 1.5.0", - "oci-spec 0.7.1", + "oci-spec", "olpc-cjson", "regex", "reqwest 0.12.9", @@ -4831,23 +4837,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "oci-spec" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5a3fe998d50101ae009351fec56d88a69f4ed182e11000e711068c2f5abf72" -dependencies = [ - "derive_builder 0.20.2", - "getset", - "once_cell", - "regex", - "serde", - "serde_json", - "strum 0.26.3", - "strum_macros 0.26.4", - "thiserror 1.0.69", -] - [[package]] name = "oci-spec" version = "0.7.1" @@ -4861,7 +4850,7 @@ dependencies = [ "serde_json", "strum 0.26.3", "strum_macros 0.26.4", - "thiserror 2.0.6", + "thiserror 2.0.11", ] [[package]] @@ -4894,15 +4883,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.69" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if 1.0.0", @@ -5290,7 +5279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.6", + "thiserror 2.0.11", "ucd-trie", ] @@ -5626,24 +5615,23 @@ dependencies = [ [[package]] name = "procfs" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" dependencies = [ "bitflags 2.6.0", "chrono", "flate2", "hex", - "lazy_static 1.5.0", "procfs-core", "rustix", ] [[package]] name = "procfs-core" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" dependencies = [ "bitflags 2.6.0", "chrono", @@ -5695,7 +5683,7 @@ dependencies = [ "prost 0.8.0", "prost-types 0.8.0", "tempfile", - "which", + "which 4.4.2", ] [[package]] @@ -5873,7 +5861,7 @@ dependencies = [ "protobuf-support", "tempfile", "thiserror 1.0.69", - "which", + "which 4.4.2", ] [[package]] @@ -5949,7 +5937,7 @@ dependencies = [ "rustc-hash", "rustls 0.23.20", "socket2", - "thiserror 2.0.6", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -5968,7 +5956,7 @@ dependencies = [ "rustls 0.23.20", "rustls-pki-types", "slab", - "thiserror 2.0.6", + "thiserror 2.0.11", "tinyvec", "tracing", "web-time", @@ -6403,6 +6391,28 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + [[package]] name = "ron" version = "0.8.1" @@ -6837,9 +6847,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.217" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] @@ -6854,11 +6864,20 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", @@ -6876,9 +6895,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.137" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -8231,11 +8250,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.6" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.6", + "thiserror-impl 2.0.11", ] [[package]] @@ -8251,9 +8270,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.6" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", @@ -8788,12 +8807,13 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "ttrpc" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e376927d4422245ae3e0a0d7df0e805f99652536999b5c671144de9fe4120d8c" +checksum = "2c580c498a547b4c083ec758be543e11a0772e03013aef4cdb1fbe77c8b62cae" dependencies = [ "byteorder", "crossbeam", + "home", "libc", "log", "nix 0.26.4", @@ -9395,12 +9415,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.221.2" +version = "0.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17a3bd88f2155da63a1f2fcb8a56377a24f0b6dfed12733bb5f544e86f690c5" +checksum = "b7249cf8cb0c6b9cb42bce90c0a5feb276fbf963fa385ff3d818ab3d90818ed6" dependencies = [ "leb128", - "wasmparser 0.221.2", + "wasmparser 0.224.0", ] [[package]] @@ -9571,13 +9591,12 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.220.0" +version = "0.223.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e246c2772ce3ebc83f89a2d4487ac5794cad6c309b2071818a88c7db7c36d87b" +checksum = "d5a99faceb1a5a84dd6084ec4bfa4b2ab153b5793b43fd8f58b89232634afc35" dependencies = [ - "ahash", "bitflags 2.6.0", - "hashbrown 0.14.5", + "hashbrown 0.15.2", "indexmap 2.7.0", "semver", "serde", @@ -9585,9 +9604,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.221.2" +version = "0.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9845c470a2e10b61dd42c385839cdd6496363ed63b5c9e420b5488b77bd22083" +checksum = "65881a664fdd43646b647bb27bf186ab09c05bf56779d40aed4c6dce47d423f5" dependencies = [ "bitflags 2.6.0", "indexmap 2.7.0", @@ -9937,24 +9956,24 @@ dependencies = [ [[package]] name = "wast" -version = "221.0.2" +version = "224.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc4470b9de917ba199157d1f0ae104f2ae362be728c43e68c571c7715bd629e" +checksum = "d722a51e62b669d17e5a9f6bc8ec210178b37d869114355aa46989686c5c6391" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width 0.2.0", - "wasm-encoder 0.221.2", + "wasm-encoder 0.224.0", ] [[package]] name = "wat" -version = "1.221.2" +version = "1.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1f3c6d82af47286494c6caea1d332037f5cbeeac82bbf5ef59cb8c201c466e" +checksum = "71dece6a7dd5bcbcf8d256606c7fb3faa36286d46bf3f98185407719a5ceede2" dependencies = [ - "wast 221.0.2", + "wast 224.0.0", ] [[package]] @@ -10017,6 +10036,18 @@ dependencies = [ "rustix", ] +[[package]] +name = "which" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a9e33648339dc1642b0e36e21b3385e6148e289226f657c809dee59df5028" +dependencies = [ + "either", + "env_home", + "rustix", + "winsafe", +] + [[package]] name = "whoami" version = "1.5.2" @@ -10324,6 +10355,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + [[package]] name = "winx" version = "0.36.4" @@ -10699,3 +10736,16 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zygote" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b78cf6140893151497b58da3c52d4e4dda37be26273b4acefe92a6f294d7cb6" +dependencies = [ + "libc", + "nix 0.29.0", + "rmp-serde", + "serde", + "thiserror 2.0.11", +] diff --git a/containerd-shim-spin/Cargo.toml b/containerd-shim-spin/Cargo.toml index e4ba22d4..8ac3af91 100644 --- a/containerd-shim-spin/Cargo.toml +++ b/containerd-shim-spin/Cargo.toml @@ -11,8 +11,7 @@ Containerd shim for running Spin workloads. """ [dependencies] -containerd-shim-wasm = { version ="0.8.0", default-features = false } -containerd-shim = "0.7.4" +containerd-shim-wasm = { version ="0.9.0", default-features = false } http = "1" log = "0.4" spin-app = { git = "https://github.com/fermyon/spin", tag = "v3.1.2" } @@ -44,7 +43,7 @@ serde = "1.0" serde_json = "1.0" url = "2.5" anyhow = "1.0" -oci-spec = "0.6.3" +oci-spec = "0.7" futures = "0.3" ctrlc = { version = "3.4", features = ["termination"] } diff --git a/containerd-shim-spin/src/engine.rs b/containerd-shim-spin/src/engine.rs index 9fd76506..2de2b8ca 100644 --- a/containerd-shim-spin/src/engine.rs +++ b/containerd-shim-spin/src/engine.rs @@ -6,7 +6,7 @@ use std::{ use anyhow::{Context, Result}; use containerd_shim_wasm::{ - container::{Engine, RuntimeContext, Stdio}, + container::{Engine, RuntimeContext}, sandbox::WasmLayer, version, }; @@ -61,9 +61,7 @@ impl Engine for SpinEngine { "spin" } - fn run_wasi(&self, ctx: &impl RuntimeContext, stdio: Stdio) -> Result { - stdio.redirect()?; - + fn run_wasi(&self, ctx: &impl RuntimeContext) -> Result { // Set the container environment variables which will be collected by Spin's // [environment variable provider]. We use these variables to configure both the Spin runtime // and the Spin application per the [SKIP 003] proposal. @@ -258,7 +256,9 @@ impl SpinEngine { #[cfg(test)] mod tests { - use oci_spec::image::MediaType; + use std::str::FromStr as _; + + use oci_spec::image::{Digest, MediaType}; use super::*; @@ -277,7 +277,10 @@ mod tests { config: oci_spec::image::Descriptor::new( MediaType::Other(constants::OCI_LAYER_MEDIA_TYPE_WASM.to_string()), 1024, - "sha256:1234", + Digest::from_str( + "sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b", + ) + .unwrap(), ), }, // Precompiled @@ -286,7 +289,10 @@ mod tests { config: oci_spec::image::Descriptor::new( MediaType::Other(constants::OCI_LAYER_MEDIA_TYPE_WASM.to_string()), 1024, - "sha256:1234", + Digest::from_str( + "sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b", + ) + .unwrap(), ), }, // Content that should be skipped @@ -295,7 +301,10 @@ mod tests { config: oci_spec::image::Descriptor::new( MediaType::Other(spin_oci::client::DATA_MEDIATYPE.to_string()), 1024, - "sha256:1234", + Digest::from_str( + "sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b", + ) + .unwrap(), ), }, ]; diff --git a/containerd-shim-spin/src/main.rs b/containerd-shim-spin/src/main.rs index 75b5915c..a8d454b3 100644 --- a/containerd-shim-spin/src/main.rs +++ b/containerd-shim-spin/src/main.rs @@ -1,7 +1,7 @@ -use containerd_shim::Config; use containerd_shim_wasm::{ container::Instance, sandbox::cli::{revision, shim_main, version}, + Config, }; mod constants; diff --git a/containerd-shim-spin/src/utils.rs b/containerd-shim-spin/src/utils.rs index 3f53efab..e0969e08 100644 --- a/containerd-shim-spin/src/utils.rs +++ b/containerd-shim-spin/src/utils.rs @@ -89,7 +89,9 @@ pub(crate) fn configure_application_variables_from_environment_variables( #[cfg(test)] mod tests { - use std::env; + use std::{env, str::FromStr}; + + use oci_spec::image::Digest; use super::*; @@ -140,7 +142,10 @@ mod tests { config: oci_spec::image::Descriptor::new( MediaType::Other(constants::OCI_LAYER_MEDIA_TYPE_WASM.to_string()), 1024, - "sha256:1234", + Digest::from_str( + "sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b", + ) + .unwrap(), ), }; // Should be ignored @@ -149,7 +154,10 @@ mod tests { config: oci_spec::image::Descriptor::new( MediaType::Other(spin_oci::client::DATA_MEDIATYPE.to_string()), 1024, - "sha256:1234", + Digest::from_str( + "sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b", + ) + .unwrap(), ), }; assert!(is_wasm_content(&wasm_content).is_some());