Skip to content

Commit

Permalink
make it os agnostic
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Prendes <[email protected]>
  • Loading branch information
jprendes committed Sep 2, 2023
1 parent 46edb93 commit 1c5b80a
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 134 deletions.
1 change: 0 additions & 1 deletion crates/containerd-shim-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ pub mod services;
#[cfg_attr(windows, path = "sys/windows/mod.rs")]
pub(crate) mod sys;

#[cfg(all(feature = "libcontainer", not(target_os = "windows")))]
pub mod container;
26 changes: 26 additions & 0 deletions crates/containerd-shim-wasm/src/sys/common/container/instance.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use crate::container::engine::Engine;
use crate::sandbox::instance::Wait;
use crate::sandbox::{Error as SandboxError, Instance as SandboxInstance, InstanceConfig};

pub struct Instance<E: Engine> {
engine: std::marker::PhantomData<E>,
}

impl<E: Engine> SandboxInstance for Instance<E> {
type Engine = E;
fn new(_id: String, _cfg: Option<&InstanceConfig<Self::Engine>>) -> Self {
todo!();
}
fn start(&self) -> Result<u32, SandboxError> {
todo!();
}
fn kill(&self, _signal: u32) -> Result<(), SandboxError> {
todo!();
}
fn delete(&self) -> Result<(), SandboxError> {
todo!();
}
fn wait(&self, _waiter: &Wait) -> Result<(), SandboxError> {
todo!();
}
}
2 changes: 2 additions & 0 deletions crates/containerd-shim-wasm/src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[cfg_attr(feature = "libcontainer", path = "./container/mod.rs")]
#[cfg_attr(not(feature = "libcontainer"), path = "../common/container/mod.rs")]
pub mod container;
pub mod metrics;
pub mod networking;
Expand Down
51 changes: 0 additions & 51 deletions crates/containerd-shim-wasm/src/sys/windows/container/instance.rs

This file was deleted.

1 change: 1 addition & 0 deletions crates/containerd-shim-wasm/src/sys/windows/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[path = "../common/container/mod.rs"]
pub mod container;
pub mod metrics;
pub mod networking;
Expand Down
40 changes: 0 additions & 40 deletions crates/containerd-shim-wasmedge/src/instance/instance_windows.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/containerd-shim-wasmedge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use std::env;

use containerd_shim::parse;

#[cfg_attr(unix, path = "instance/instance_linux.rs")]
#[cfg_attr(windows, path = "instance/instance_windows.rs")]
pub mod instance;

pub use instance::WasmEdgeInstance;
Expand Down
38 changes: 0 additions & 38 deletions crates/containerd-shim-wasmtime/src/instance/instance_windows.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/containerd-shim-wasmtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use std::env;

use containerd_shim::parse;

#[cfg_attr(unix, path = "instance/instance_linux.rs")]
#[cfg_attr(windows, path = "instance/instance_windows.rs")]
pub mod instance;

pub use instance::WasmtimeInstance;
Expand Down

0 comments on commit 1c5b80a

Please sign in to comment.