MCPcopy Create free account
hub / github.com/bootc-dev/bootc / rollback_ostree

Function rollback_ostree

crates/lib/src/cli.rs:1525–1545  ·  view source on GitHub ↗
(
    opts: &RollbackOpts,
    storage: &Storage,
    booted_ostree: &BootedOstree<'_>,
)

Source from the content-addressed store, hash-verified

1523/// Implementation of the `bootc rollback` CLI command for ostree backend.
1524#[context("Rollback (ostree)")]
1525async fn rollback_ostree(
1526 opts: &RollbackOpts,
1527 storage: &Storage,
1528 booted_ostree: &BootedOstree<'_>,
1529) -> Result<()> {
1530 crate::deploy::rollback(storage).await?;
1531
1532 if opts.soft_reboot.is_some() {
1533 // Get status of rollback deployment to check soft-reboot capability
1534 let host = crate::status::get_status(booted_ostree)?.1;
1535
1536 handle_soft_reboot(
1537 opts.soft_reboot,
1538 host.status.rollback.as_ref(),
1539 "rollback",
1540 || soft_reboot_rollback(booted_ostree),
1541 )?;
1542 }
1543
1544 Ok(())
1545}
1546
1547/// Implementation of the `bootc rollback` CLI command.
1548#[context("Rollback")]

Callers 1

rollbackFunction · 0.85

Calls 5

get_statusFunction · 0.85
handle_soft_rebootFunction · 0.85
soft_reboot_rollbackFunction · 0.85
rollbackFunction · 0.70
as_refMethod · 0.45

Tested by

no test coverage detected