Skip to content

Commit bdbee17

Browse files
committed
spec: Add stateroot
As we head towards factory reset work, this will be of critical importance. For now this only shows up in the API, not in human readable status. Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 3d93701 commit bdbee17

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

lib/src/spec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ pub struct ImageStatus {
156156
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
157157
#[serde(rename_all = "camelCase")]
158158
pub struct BootEntryOstree {
159+
/// The name of the storage for /etc and /var content
160+
pub stateroot: String,
159161
/// The ostree commit checksum
160162
pub checksum: String,
161163
/// The deployment serial

lib/src/status.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ fn boot_entry_from_deployment(
163163
checksum: deployment.csum().into(),
164164
// SAFETY: The deployserial is really unsigned
165165
deploy_serial: deployment.deployserial().try_into().unwrap(),
166+
stateroot: deployment.stateroot().into(),
166167
}),
167168
};
168169
Ok(r)

tmt/tests/booted/readonly/001-test-status.nu

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ assert equal $st.apiVersion org.containers.bootc/v1
1212
let st = bootc status --format=yaml | from yaml
1313
assert equal $st.apiVersion org.containers.bootc/v1
1414
assert ($st.status.booted.image.timestamp != null)
15+
let ostree = $st.status.booted.ostree
16+
if $ostree != null {
17+
assert ($ostree.stateroot != null)
18+
}
1519

1620
let st = bootc status --json --booted | from json
1721
assert equal $st.apiVersion org.containers.bootc/v1

0 commit comments

Comments
 (0)