Skip to content

Commit d3fdd62

Browse files
committed
Use version API from ostree-ext
In preparation for ostreedev/ostree-rs-ext#454 Signed-off-by: Colin Walters <[email protected]>
1 parent 71142b7 commit d3fdd62

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rust-version = "1.63.0"
1111
[dependencies]
1212
anyhow = "1.0"
1313
camino = "1.0.4"
14-
ostree-ext = "0.10.1"
14+
ostree-ext = "0.10.5"
1515
clap = { version= "3.2", features = ["derive"] }
1616
clap_mangen = { version = "0.1", optional = true }
1717
cap-std-ext = "1.0.1"

lib/src/status.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,12 @@ pub(crate) async fn status(opts: super::cli::StatusOpts) -> Result<()> {
131131
} else {
132132
let state = ostree_container::store::query_image_commit(repo, &commit)?;
133133
println!(" Digest: {}", state.manifest_digest.as_str());
134-
let config = state.configuration.as_ref();
135-
let cconfig = config.and_then(|c| c.config().as_ref());
136-
let labels = cconfig.and_then(|c| c.labels().as_ref());
137-
if let Some(labels) = labels {
138-
if let Some(version) = labels.get("version") {
139-
println!(" Version: {version}");
140-
}
134+
let version = state
135+
.configuration
136+
.as_ref()
137+
.and_then(ostree_container::version_for_config);
138+
if let Some(version) = version {
139+
println!(" Version: {version}");
141140
}
142141
}
143142
} else {

tests/kolainst/basic

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ cd $(mktemp -d)
1212

1313
case "${AUTOPKGTEST_REBOOT_MARK:-}" in
1414
"")
15+
bootc status > status.txt
16+
grep 'Version:' status.txt
1517
bootc status --json > status.json
1618
image=$(jq -r '.[0].image.image' < status.json)
1719
echo "booted into $image"

0 commit comments

Comments
 (0)