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

Function imgref_for_switch

crates/lib/src/cli.rs:1367–1378  ·  view source on GitHub ↗
(opts: &SwitchOpts)

Source from the content-addressed store, hash-verified

1365 Ok(())
1366}
1367pub(crate) fn imgref_for_switch(opts: &SwitchOpts) -> Result<ImageReference> {
1368 let transport = ostree_container::Transport::try_from(opts.transport.as_str())?;
1369 let imgref = ostree_container::ImageReference {
1370 transport,
1371 name: opts.target.to_string(),
1372 };
1373 let sigverify = sigpolicy_from_opt(opts.enforce_container_sigpolicy);
1374 let target = ostree_container::OstreeImageReference { sigverify, imgref };
1375 let target = ImageReference::from(target);
1376
1377 return Ok(target);
1378}
1379
1380/// Implementation of the `bootc switch` CLI command for ostree backend.
1381#[context("Switching (ostree)")]

Callers 3

switch_ostreeFunction · 0.85
switchFunction · 0.85
switch_composefsFunction · 0.85

Calls 1

sigpolicy_from_optFunction · 0.85

Tested by

no test coverage detected