Skip to content

Commit b1fb35c

Browse files
authored
Merge pull request #1291 from cgwalters/status-bootentry
status: Prep work for #1285
2 parents 44eb304 + 5a00f3a commit b1fb35c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

lib/src/status.rs

+14-4
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,10 @@ fn write_row_name(mut out: impl Write, s: &str, prefix_len: usize) -> Result<()>
359359
}
360360

361361
/// Write the data for a container image based status.
362-
fn human_render_imagestatus(
362+
fn human_render_slot(
363363
mut out: impl Write,
364364
slot: Slot,
365+
entry: &crate::spec::BootEntry,
365366
image: &crate::spec::ImageStatus,
366367
) -> Result<()> {
367368
let transport = &image.image.transport;
@@ -407,10 +408,18 @@ fn human_render_imagestatus(
407408
writeln!(out, "{timestamp}")?;
408409
}
409410

411+
tracing::debug!("pinned={}", entry.pinned);
412+
410413
Ok(())
411414
}
412415

413-
fn human_render_ostree(mut out: impl Write, slot: Slot, ostree_commit: &str) -> Result<()> {
416+
/// Output a rendering of a non-container boot entry.
417+
fn human_render_slot_ostree(
418+
mut out: impl Write,
419+
slot: Slot,
420+
entry: &crate::spec::BootEntry,
421+
ostree_commit: &str,
422+
) -> Result<()> {
414423
// TODO consider rendering more ostree stuff here like rpm-ostree status does
415424
let prefix = match slot {
416425
Slot::Staged => " Staged ostree".into(),
@@ -421,6 +430,7 @@ fn human_render_ostree(mut out: impl Write, slot: Slot, ostree_commit: &str) ->
421430
writeln!(out, "{prefix}")?;
422431
write_row_name(&mut out, "Commit", prefix_len)?;
423432
writeln!(out, "{ostree_commit}")?;
433+
tracing::debug!("pinned={}", entry.pinned);
424434
Ok(())
425435
}
426436

@@ -438,9 +448,9 @@ fn human_readable_output_booted(mut out: impl Write, host: &Host) -> Result<()>
438448
writeln!(out)?;
439449
}
440450
if let Some(image) = &host_status.image {
441-
human_render_imagestatus(&mut out, slot_name, image)?;
451+
human_render_slot(&mut out, slot_name, host_status, image)?;
442452
} else if let Some(ostree) = host_status.ostree.as_ref() {
443-
human_render_ostree(&mut out, slot_name, &ostree.checksum)?;
453+
human_render_slot_ostree(&mut out, slot_name, host_status, &ostree.checksum)?;
444454
} else {
445455
writeln!(out, "Current {slot_name} state is unknown")?;
446456
}

0 commit comments

Comments
 (0)