fixup! feat(podman_driver): Invoke sudo when needed for privileged
This commit is contained in:
parent
9963758a91
commit
1bd8e926b4
1 changed files with 7 additions and 2 deletions
|
|
@ -520,9 +520,14 @@ impl RunDriver for PodmanDriver {
|
|||
}
|
||||
|
||||
fn podman_run(opts: &RunOpts, cid_file: &Path) -> Command {
|
||||
let argv0 = if opts.privileged && !nix::unistd::Uid::effective().is_root() {
|
||||
"sudo"
|
||||
} else {
|
||||
"podman"
|
||||
};
|
||||
let command = cmd!(
|
||||
if opts.priviledged && !nix::unistd::Uid::effective().is_root() => "sudo",
|
||||
"podman",
|
||||
argv0,
|
||||
if argv0 != "podman" => "podman",
|
||||
"run",
|
||||
format!("--cidfile={}", cid_file.display()),
|
||||
if opts.privileged => [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue