Skip to content

Commit

Permalink
Use authfile from ostree_ext
Browse files Browse the repository at this point in the history
Signed-off-by: John Eckersberg <[email protected]>
  • Loading branch information
jeckersb committed Jul 2, 2024
1 parent 2081803 commit fe098b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 77 deletions.
1 change: 0 additions & 1 deletion lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub(crate) mod kargs;
mod lints;
mod lsm;
pub(crate) mod metadata;
mod ostree_authfile;
mod podman;
mod podman_ostree;
mod reboot;
Expand Down
72 changes: 0 additions & 72 deletions lib/src/ostree_authfile.rs

This file was deleted.

7 changes: 3 additions & 4 deletions lib/src/podman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//! Wrapper for podman which writes to a bootc-owned root.

use std::os::unix::process::CommandExt;
use std::path::Path;

use anyhow::{anyhow, Result};
use camino::{Utf8Path, Utf8PathBuf};
Expand All @@ -14,7 +13,6 @@ use serde::Deserialize;
use tokio::process::Command;

use crate::hostexec::run_in_host_mountns;
use crate::ostree_authfile;
use crate::spec::ImageReference;
use crate::task::Task;
use crate::utils::{cmd_in_root, newline_trim_vec_to_string};
Expand Down Expand Up @@ -63,14 +61,15 @@ pub(crate) async fn podman_pull(
image: &ImageReference,
quiet: bool,
) -> Result<String> {
let authfile = ostree_authfile::get_global_authfile_path()?;
let authfile =
ostree_ext::globals::get_global_authfile(rootfs)?.map(|(authfile, _fd)| authfile);
let mut cmd = podman_in_root(rootfs)?;
let image = OstreeImageReference::from(image.clone());
let pull_spec_image = image.imgref.to_string();
tracing::debug!("Pulling {pull_spec_image}");
let child = cmd
.args(["pull"])
.args(authfile.iter().flat_map(|v| [Path::new("--authfile"), v]))
.args(authfile.iter().flat_map(|v| ["--authfile", v.as_str()]))
.args(quiet.then_some("--quiet"))
.arg(&pull_spec_image)
.stdout(std::process::Stdio::piped())
Expand Down

0 comments on commit fe098b3

Please sign in to comment.