mirror of
https://github.com/faas-rs/faasd-in-rust.git
synced 2025-06-08 07:55:04 +00:00
fix(ctrd):移动cni创建逻辑到容器创建过程 (#87)
This commit is contained in:
parent
7cbe9361db
commit
02a0f8777a
@ -67,7 +67,7 @@ async fn deploy(config: &FunctionDeployment) -> Result<(), CustomError> {
|
||||
namespace
|
||||
);
|
||||
|
||||
ContainerdManager::new_task(&config.service, &namespace, &config.image)
|
||||
ContainerdManager::new_task(&config.service, &namespace)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
CustomError::OtherError(format!(
|
||||
|
@ -75,6 +75,7 @@ impl ContainerdManager {
|
||||
};
|
||||
|
||||
Self::do_create_container(container, ns).await?;
|
||||
Self::prepare_cni_network(cid, ns, image_name)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@ -136,9 +137,8 @@ impl ContainerdManager {
|
||||
}
|
||||
|
||||
/// 创建并启动任务
|
||||
pub async fn new_task(cid: &str, ns: &str, image_name: &str) -> Result<(), ContainerdError> {
|
||||
pub async fn new_task(cid: &str, ns: &str) -> Result<(), ContainerdError> {
|
||||
let mounts = Self::get_mounts(cid, ns).await?;
|
||||
Self::prepare_cni_network(cid, ns, image_name)?;
|
||||
Self::do_create_task(cid, ns, mounts).await?;
|
||||
Self::do_start_task(cid, ns).await?;
|
||||
Ok(())
|
||||
|
Loading…
x
Reference in New Issue
Block a user