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

Function stage

crates/lib/src/deploy.rs:1012–1150  ·  view source on GitHub ↗
(
    sysroot: &Storage,
    from: MergeState,
    image: &ImageState,
    spec: &RequiredHostSpec<'_>,
    prog: ProgressWriter,
    lock_finalization: bool,
)

Source from the content-addressed store, hash-verified

1010/// Stage (queue deployment of) a fetched container image.
1011#[context("Staging")]
1012pub(crate) async fn stage(
1013 sysroot: &Storage,
1014 from: MergeState,
1015 image: &ImageState,
1016 spec: &RequiredHostSpec<'_>,
1017 prog: ProgressWriter,
1018 lock_finalization: bool,
1019) -> Result<()> {
1020 // Log the staging operation to systemd journal with comprehensive upgrade information
1021 const STAGE_JOURNAL_ID: &str = "8f7a2b1c3d4e5f6a7b8c9d0e1f2a3b4c";
1022
1023 tracing::info!(
1024 message_id = STAGE_JOURNAL_ID,
1025 bootc.image.reference = &spec.image.image,
1026 bootc.image.transport = &spec.image.transport,
1027 bootc.manifest_digest = image.manifest_digest.as_ref(),
1028 "Staging image for deployment: {} (digest: {})",
1029 spec.image,
1030 image.manifest_digest
1031 );
1032
1033 let mut subtask = SubTaskStep {
1034 subtask: "merging".into(),
1035 description: "Merging Image".into(),
1036 id: "fetching".into(),
1037 completed: false,
1038 };
1039 let mut subtasks = vec![];
1040 prog.send(Event::ProgressSteps {
1041 task: "staging".into(),
1042 description: "Deploying Image".into(),
1043 id: image.manifest_digest.clone().as_ref().into(),
1044 steps_cached: 0,
1045 steps: 0,
1046 steps_total: 3,
1047 subtasks: subtasks
1048 .clone()
1049 .into_iter()
1050 .chain([subtask.clone()])
1051 .collect(),
1052 })
1053 .await;
1054
1055 subtask.completed = true;
1056 subtasks.push(subtask.clone());
1057 subtask.subtask = "deploying".into();
1058 subtask.id = "deploying".into();
1059 subtask.description = "Deploying Image".into();
1060 subtask.completed = false;
1061 prog.send(Event::ProgressSteps {
1062 task: "staging".into(),
1063 description: "Deploying Image".into(),
1064 id: image.manifest_digest.clone().as_ref().into(),
1065 steps_cached: 0,
1066 steps: 1,
1067 steps_total: 3,
1068 subtasks: subtasks
1069 .clone()

Callers 4

install_resetFunction · 0.85
upgradeFunction · 0.85
switch_ostreeFunction · 0.85
edit_ostreeFunction · 0.85

Calls 9

origin_from_imagerefFunction · 0.85
pull_bound_imagesFunction · 0.85
cleanupFunction · 0.85
write_reboot_requiredFunction · 0.85
sendMethod · 0.80
deployFunction · 0.70
intoMethod · 0.45
as_refMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected