Skip to content
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

install: Add some more debug/trace calls #412

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ pub(crate) fn require_root() -> Result<()> {
if !rustix::thread::capability_is_in_bounding_set(rustix::thread::Capability::SystemAdmin)? {
anyhow::bail!("This command requires full root privileges (CAP_SYS_ADMIN)");
}
tracing::trace!("Verified uid 0 with CAP_SYS_ADMIN");
Ok(())
}

Expand Down
4 changes: 4 additions & 0 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ impl SourceInfo {
transport: ostree_container::Transport::ContainerStorage,
name: container_info.image.clone(),
};
tracing::debug!("Finding digest for image ID {}", container_info.imageid);
let digest = crate::podman::imageid_to_digest(&container_info.imageid)?;

let root = Dir::open_ambient_dir("/", cap_std::ambient_authority())?;
Expand Down Expand Up @@ -848,6 +849,7 @@ fn require_host_pidns() -> Result<()> {
if rustix::process::getpid().is_init() {
anyhow::bail!("This command must be run with --pid=host")
}
tracing::trace!("OK: we're not pid 1");
Ok(())
}

Expand Down Expand Up @@ -975,6 +977,7 @@ async fn prepare_install(
source_opts: InstallSourceOpts,
target_opts: InstallTargetOpts,
) -> Result<Arc<State>> {
tracing::trace!("Preparing install");
// We need full root privileges, i.e. --privileged in podman
crate::cli::require_root()?;
require_host_pidns()?;
Expand All @@ -996,6 +999,7 @@ async fn prepare_install(
"Cannot install from rootless podman; this command must be run as root"
);
}
tracing::trace!("Read container engine info {:?}", container_info.engine);

SourceInfo::from_container(&container_info)?
}
Expand Down