From 81a57058b6fd6fe9da4fbc7254a3c47bd4a8da6e Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Thu, 22 Jul 2021 12:39:08 -0700 Subject: [PATCH] Fix shim example Signed-off-by: Maksym Pavlenko --- crates/shim/examples/{empty.rs => empty-shim.rs} | 13 +++++++++---- crates/shim/src/lib.rs | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) rename crates/shim/examples/{empty.rs => empty-shim.rs} (83%) diff --git a/crates/shim/examples/empty.rs b/crates/shim/examples/empty-shim.rs similarity index 83% rename from crates/shim/examples/empty.rs rename to crates/shim/examples/empty-shim.rs index 9e48895..d8eaff7 100644 --- a/crates/shim/examples/empty.rs +++ b/crates/shim/examples/empty-shim.rs @@ -1,8 +1,13 @@ -use containerd_protos::shim::shim::DeleteResponse; -use log::debug; -use shim::StartOpts; use std::error::Error; +use containerd_shim as shim; +use shim::protos; + +use shim::api::DeleteResponse; +use shim::StartOpts; + +use log::debug; + struct Service; impl shim::Shim for Service { @@ -24,7 +29,7 @@ impl shim::Task for Service { &self, _ctx: &shim::Context, _request: shim::api::StateRequest, - ) -> shim::protos::ttrpc::Result { + ) -> protos::ttrpc::Result { debug!("Get state"); Ok(shim::api::StateResponse::default()) } diff --git a/crates/shim/src/lib.rs b/crates/shim/src/lib.rs index 66195c3..7361628 100644 --- a/crates/shim/src/lib.rs +++ b/crates/shim/src/lib.rs @@ -9,7 +9,7 @@ use std::sync::Arc; use std::thread; use std::time; -use containerd_shim_protos as protos; +pub use containerd_shim_protos as protos; use protos::protobuf::Message; use protos::shim::{shim::DeleteResponse, shim_ttrpc::create_task}; use protos::ttrpc::Server;