Skip to content

spec: Add stateroot #1319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/src/fixtures/spec-only-booted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ status:
ostree:
checksum: 439f6bd2e2361bee292c1f31840d798c5ac5ba76483b8021dc9f7b0164ac0f48
deploySerial: 0
stateroot: default
rollback: null
rollbackQueued: false
type: bootcHost
1 change: 1 addition & 0 deletions lib/src/fixtures/spec-ostree-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ status:
ostree:
checksum: 41af286dc0b172ed2f1ca934fd2278de4a1192302ffa07087cea2682e7d372e3
deploySerial: 0
stateroot: default
rollback: null
isContainer: false
2 changes: 2 additions & 0 deletions lib/src/fixtures/spec-ostree-to-bootc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ status:
ostree:
checksum: 05cbf6dcae32e7a1c5a0774a648a073a5834a305ca92204b53fb6c281fe49db1
deploySerial: 0
stateroot: default
booted:
image: null
cachedUpdate: null
Expand All @@ -33,6 +34,7 @@ status:
ostree:
checksum: f9fa3a553ceaaaf30cf85bfe7eed46a822f7b8fd7e14c1e3389cbc3f6d27f791
deploySerial: 0
stateroot: default
rollback: null
rollbackQueued: false
type: null
2 changes: 2 additions & 0 deletions lib/src/fixtures/spec-rfe-ostree-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ status:
ostree:
checksum: 1c24260fdd1be20f72a4a97a75c582834ee3431fbb0fa8e4f482bb219d633a45
deploySerial: 0
stateroot: default
booted:
image: null
cachedUpdate: null
Expand All @@ -24,6 +25,7 @@ status:
ostree:
checksum: f9fa3a553ceaaaf30cf85bfe7eed46a822f7b8fd7e14c1e3389cbc3f6d27f791
deploySerial: 0
stateroot: default
rollback: null
rollbackQueued: false
type: null
2 changes: 2 additions & 0 deletions lib/src/fixtures/spec-staged-booted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ status:
ostree:
checksum: 3c6dad657109522e0b2e49bf44b5420f16f0b438b5b9357e5132211cfbad135d
deploySerial: 0
stateroot: default
booted:
image:
image:
Expand All @@ -39,5 +40,6 @@ status:
ostree:
checksum: 26836632adf6228d64ef07a26fd3efaf177104efd1f341a2cf7909a3e4e2c72c
deploySerial: 0
stateroot: default
rollback: null
isContainer: false
2 changes: 2 additions & 0 deletions lib/src/fixtures/spec-staged-rollback.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ status:
ostree:
checksum: 3c6dad657109522e0b2e49bf44b5420f16f0b438b5b9357e5132211cfbad135d
deploySerial: 0
stateroot: default
booted: null
rollback:
image:
Expand All @@ -39,4 +40,5 @@ status:
ostree:
checksum: 26836632adf6228d64ef07a26fd3efaf177104efd1f341a2cf7909a3e4e2c72c
deploySerial: 0
stateroot: default
isContainer: false
2 changes: 2 additions & 0 deletions lib/src/fixtures/spec-v1a1-orig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ status:
ostree:
checksum: 3c6dad657109522e0b2e49bf44b5420f16f0b438b5b9357e5132211cfbad135d
deploySerial: 0
stateroot: default
booted:
image:
image:
Expand All @@ -38,5 +39,6 @@ status:
ostree:
checksum: 26836632adf6228d64ef07a26fd3efaf177104efd1f341a2cf7909a3e4e2c72c
deploySerial: 0
stateroot: default
rollback: null
isContainer: false
1 change: 1 addition & 0 deletions lib/src/fixtures/spec-v1a1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ status:
ostree:
checksum: 41af286dc0b172ed2f1ca934fd2278de4a1192302ffa07087cea2682e7d372e3
deploySerial: 0
stateroot: default
rollback: null
isContainer: false
1 change: 1 addition & 0 deletions lib/src/fixtures/spec-via-local-oci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ status:
ostree:
checksum: 439f6bd2e2361bee292c1f31840d798c5ac5ba76483b8021dc9f7b0164ac0f48
deploySerial: 0
stateroot: default
rollback: null
rollbackQueued: false
type: bootcHost
2 changes: 2 additions & 0 deletions lib/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ pub struct ImageStatus {
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct BootEntryOstree {
/// The name of the storage for /etc and /var content
pub stateroot: String,
/// The ostree commit checksum
pub checksum: String,
/// The deployment serial
Expand Down
1 change: 1 addition & 0 deletions lib/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ fn boot_entry_from_deployment(
checksum: deployment.csum().into(),
// SAFETY: The deployserial is really unsigned
deploy_serial: deployment.deployserial().try_into().unwrap(),
stateroot: deployment.stateroot().into(),
}),
};
Ok(r)
Expand Down
4 changes: 4 additions & 0 deletions tmt/tests/booted/readonly/001-test-status.nu
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ assert equal $st.apiVersion org.containers.bootc/v1
let st = bootc status --format=yaml | from yaml
assert equal $st.apiVersion org.containers.bootc/v1
assert ($st.status.booted.image.timestamp != null)
let ostree = $st.status.booted.ostree
if $ostree != null {
assert ($ostree.stateroot != null)
}

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