Skip to content

Commit

Permalink
store: Get timestamp from config or annotation
Browse files Browse the repository at this point in the history
Sadly this code got forked from ostree-rs-ext, where
we were doing things correctly. Add the fallback
to the config.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Oct 10, 2024
1 parent 927ad1a commit ca9534c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/src/store/ostree_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fn create_imagestatus(
l.get(oci_spec::image::ANNOTATION_CREATED)
.map(|s| s.as_str())
})
.or_else(|| config.created().as_deref())
.and_then(try_deserialize_timestamp);

let version = ostree_container::version_for_config(config).map(ToOwned::to_owned);
Expand Down
1 change: 1 addition & 0 deletions tests/booted/readonly/001-test-status.nu
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ let st = bootc status --json --format-version=0 | from json
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)
tap ok

0 comments on commit ca9534c

Please sign in to comment.