Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(spin/assets): support loading static assets #13

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Changes from 1 commit
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
13 changes: 13 additions & 0 deletions containerd-shim-spin/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ impl SpinEngine {
.context("failed to create spin.json")?
.write_all(&artifact.layer)
.context("failed to write spin.json")?;
let lockfile = std::str::from_utf8(&artifact.layer)?;
log::info!("lockfile: {:?}", lockfile);
kate-goldenring marked this conversation as resolved.
Show resolved Hide resolved
}
MediaType::Other(name)
if name == "application/vnd.wasm.content.layer.v1+wasm" =>
Expand All @@ -97,6 +99,17 @@ impl SpinEngine {
.write_wasm(&artifact.layer, &artifact.config.digest())
.await?;
}
MediaType::Other(name)
if name == "application/vnd.wasm.content.layer.v1+data" =>
{
log::info!(
"writing data layer to cache, near {:?}",
cache.manifests_dir()
);
cache
.write_data(&artifact.layer, &artifact.config.digest())
.await?;
}
_ => {}
}
}
Expand Down