mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-18 01:13:56 +00:00
Merge pull request #3370 from lifupan/fix_namespace
agent: fix the issue of creating new namespaces for agent
This commit is contained in:
commit
eac003462d
@ -100,7 +100,7 @@ impl Namespace {
|
|||||||
self.path = new_ns_path.clone().into_os_string().into_string().unwrap();
|
self.path = new_ns_path.clone().into_os_string().into_string().unwrap();
|
||||||
let hostname = self.hostname.clone();
|
let hostname = self.hostname.clone();
|
||||||
|
|
||||||
let new_thread = tokio::spawn(async move {
|
let new_thread = std::thread::spawn(move || {
|
||||||
if let Err(err) = || -> Result<()> {
|
if let Err(err) = || -> Result<()> {
|
||||||
let origin_ns_path = get_current_thread_ns_path(ns_type.get());
|
let origin_ns_path = get_current_thread_ns_path(ns_type.get());
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ impl Namespace {
|
|||||||
});
|
});
|
||||||
|
|
||||||
new_thread
|
new_thread
|
||||||
.await
|
.join()
|
||||||
.map_err(|e| anyhow!("Failed to join thread {:?}!", e))??;
|
.map_err(|e| anyhow!("Failed to join thread {:?}!", e))??;
|
||||||
|
|
||||||
Ok(self)
|
Ok(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user