-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unnecessary chdir #2780
Remove unnecessary chdir #2780
Changes from all commits
ada9cd1
874414a
524ae7a
8de2233
b536591
a816712
4a49759
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
use std::{fs, io::Write, os::unix::prelude::RawFd, path::PathBuf, rc::Rc}; | ||
|
||
use libcgroups::common::CgroupManager; | ||
use nix::unistd::Pid; | ||
use oci_spec::runtime::Spec; | ||
|
||
Comment on lines
+1
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thought: We should have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't know that. It is what I want! Thanks for sharing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
use super::{Container, ContainerStatus}; | ||
use crate::{ | ||
error::{LibcontainerError, MissingSpecError}, | ||
|
@@ -13,10 +19,6 @@ use crate::{ | |
utils, | ||
workload::Executor, | ||
}; | ||
use libcgroups::common::CgroupManager; | ||
use nix::unistd::Pid; | ||
use oci_spec::runtime::Spec; | ||
use std::{fs, io::Write, os::unix::prelude::RawFd, path::PathBuf, rc::Rc}; | ||
|
||
pub(super) struct ContainerBuilderImpl { | ||
/// Flag indicating if an init or a tenant container should be created | ||
|
@@ -82,7 +84,11 @@ impl ContainerBuilderImpl { | |
|
||
if matches!(self.container_type, ContainerType::InitContainer) { | ||
if let Some(hooks) = self.spec.hooks() { | ||
hooks::run_hooks(hooks.create_runtime().as_ref(), self.container.as_ref())? | ||
hooks::run_hooks( | ||
hooks.create_runtime().as_ref(), | ||
self.container.as_ref(), | ||
None, | ||
)? | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be more beneficial because we don't need to copy again when we rebuild.