mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 19:54:35 +00:00
runtime-rs: fix some variable names and typos
Fix some not perfect variable names, and some typos in logs. Fixes: #5820 Signed-off-by: Bin Liu <bin@hyper.sh>
This commit is contained in:
parent
8246de821f
commit
fb2c142f18
@ -200,12 +200,16 @@ impl RuntimeHandlerManager {
|
||||
}
|
||||
|
||||
pub async fn handler_message(&self, req: Request) -> Result<Response> {
|
||||
if let Request::CreateContainer(req) = req {
|
||||
if let Request::CreateContainer(container_config) = req {
|
||||
// get oci spec
|
||||
let bundler_path = format!("{}/{}", req.bundle, oci::OCI_SPEC_CONFIG_FILE_NAME);
|
||||
let bundler_path = format!(
|
||||
"{}/{}",
|
||||
container_config.bundle,
|
||||
oci::OCI_SPEC_CONFIG_FILE_NAME
|
||||
);
|
||||
let spec = oci::Spec::load(&bundler_path).context("load spec")?;
|
||||
|
||||
self.try_init_runtime_instance(&spec, &req.options)
|
||||
self.try_init_runtime_instance(&spec, &container_config.options)
|
||||
.await
|
||||
.context("try init runtime instance")?;
|
||||
let instance = self
|
||||
@ -215,7 +219,7 @@ impl RuntimeHandlerManager {
|
||||
|
||||
let shim_pid = instance
|
||||
.container_manager
|
||||
.create_container(req, spec)
|
||||
.create_container(container_config, spec)
|
||||
.await
|
||||
.context("create container")?;
|
||||
|
||||
|
@ -93,8 +93,8 @@ impl Container {
|
||||
|
||||
// update rootfs
|
||||
match spec.root.as_mut() {
|
||||
Some(spec) => {
|
||||
spec.path = rootfs
|
||||
Some(root) => {
|
||||
root.path = rootfs
|
||||
.get_guest_rootfs_path()
|
||||
.await
|
||||
.context("get guest rootfs path")?
|
||||
|
@ -253,7 +253,7 @@ impl ContainerManager for VirtContainerManager {
|
||||
let c = containers
|
||||
.get(container_id)
|
||||
.ok_or_else(|| Error::ContainerNotFound(container_id.to_string()))?;
|
||||
c.update(&resource).await.context("stats")
|
||||
c.update(&resource).await.context("update_container")
|
||||
}
|
||||
|
||||
async fn pid(&self) -> Result<PID> {
|
||||
|
@ -65,7 +65,7 @@ async fn send_event(
|
||||
&namespace,
|
||||
])
|
||||
.spawn()
|
||||
.context("sawn cmd")?;
|
||||
.context("spawn containerd cmd to publish event")?;
|
||||
|
||||
let stdin = child.stdin.as_mut().context("failed to open stdin")?;
|
||||
stdin
|
||||
|
@ -40,7 +40,7 @@ where
|
||||
let r = req
|
||||
.try_into()
|
||||
.map_err(|err| ttrpc::Error::Others(format!("failed to translate from shim {:?}", err)))?;
|
||||
let logger = sl!().new(o!("steam id" => ctx.mh.stream_id));
|
||||
let logger = sl!().new(o!("stream id" => ctx.mh.stream_id));
|
||||
debug!(logger, "====> task service {:?}", &r);
|
||||
let resp = s
|
||||
.handler_message(r)
|
||||
|
Loading…
Reference in New Issue
Block a user