Skip to content

Commit fe098b3

Browse files
committed
Use authfile from ostree_ext
Signed-off-by: John Eckersberg <[email protected]>
1 parent 2081803 commit fe098b3

File tree

3 files changed

+3
-77
lines changed

3 files changed

+3
-77
lines changed

lib/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub(crate) mod kargs;
2727
mod lints;
2828
mod lsm;
2929
pub(crate) mod metadata;
30-
mod ostree_authfile;
3130
mod podman;
3231
mod podman_ostree;
3332
mod reboot;

lib/src/ostree_authfile.rs

Lines changed: 0 additions & 72 deletions
This file was deleted.

lib/src/podman.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! Wrapper for podman which writes to a bootc-owned root.
44
55
use std::os::unix::process::CommandExt;
6-
use std::path::Path;
76

87
use anyhow::{anyhow, Result};
98
use camino::{Utf8Path, Utf8PathBuf};
@@ -14,7 +13,6 @@ use serde::Deserialize;
1413
use tokio::process::Command;
1514

1615
use crate::hostexec::run_in_host_mountns;
17-
use crate::ostree_authfile;
1816
use crate::spec::ImageReference;
1917
use crate::task::Task;
2018
use crate::utils::{cmd_in_root, newline_trim_vec_to_string};
@@ -63,14 +61,15 @@ pub(crate) async fn podman_pull(
6361
image: &ImageReference,
6462
quiet: bool,
6563
) -> Result<String> {
66-
let authfile = ostree_authfile::get_global_authfile_path()?;
64+
let authfile =
65+
ostree_ext::globals::get_global_authfile(rootfs)?.map(|(authfile, _fd)| authfile);
6766
let mut cmd = podman_in_root(rootfs)?;
6867
let image = OstreeImageReference::from(image.clone());
6968
let pull_spec_image = image.imgref.to_string();
7069
tracing::debug!("Pulling {pull_spec_image}");
7170
let child = cmd
7271
.args(["pull"])
73-
.args(authfile.iter().flat_map(|v| [Path::new("--authfile"), v]))
72+
.args(authfile.iter().flat_map(|v| ["--authfile", v.as_str()]))
7473
.args(quiet.then_some("--quiet"))
7574
.arg(&pull_spec_image)
7675
.stdout(std::process::Stdio::piped())

0 commit comments

Comments
 (0)