mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-06 12:06:49 +00:00
agent: Introduce ImageService
Introduce structure ImageService, which will be used to pull images inside the guest. Fixes: #8103 Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com> co-authored-by: wllenyj <wllenyj@linux.alibaba.com> co-authored-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
parent
42dfe0e8d1
commit
1f1ca6187d
24
src/agent/src/image.rs
Normal file
24
src/agent/src/image.rs
Normal file
@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2021 Alibaba Cloud
|
||||
// Copyright (c) 2021, 2023 IBM Corporation
|
||||
// Copyright (c) 2022 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
use crate::sandbox::Sandbox;
|
||||
|
||||
// Convenience function to obtain the scope logger.
|
||||
fn sl() -> slog::Logger {
|
||||
slog_scope::logger().new(o!("subsystem" => "image"))
|
||||
}
|
||||
|
||||
pub struct ImageService {
|
||||
sandbox: Arc<Mutex<Sandbox>>,
|
||||
}
|
||||
impl ImageService {
|
||||
pub fn new(sandbox: Arc<Mutex<Sandbox>>) -> Self {
|
||||
Self { sandbox }
|
||||
}
|
||||
}
|
@ -73,6 +73,7 @@ use tokio::{
|
||||
task::JoinHandle,
|
||||
};
|
||||
|
||||
mod image;
|
||||
mod rpc;
|
||||
mod tracer;
|
||||
|
||||
|
@ -54,6 +54,7 @@ use rustjail::process::ProcessOperations;
|
||||
|
||||
use crate::device::{add_devices, get_virtio_blk_pci_device_name, update_env_pci};
|
||||
use crate::features::get_build_features;
|
||||
use crate::image;
|
||||
use crate::linux_abi::*;
|
||||
use crate::metrics::get_metrics;
|
||||
use crate::mount::baremount;
|
||||
|
Loading…
Reference in New Issue
Block a user