@@ -21,7 +21,9 @@ use camino::Utf8PathBuf;
21
21
use cap_std:: fs:: Dir ;
22
22
use cap_std_ext:: cap_std;
23
23
use cap_std_ext:: prelude:: CapStdExtDirExt ;
24
+ use chrono:: prelude:: * ;
24
25
use clap:: ValueEnum ;
26
+ use ostree_ext:: oci_spec;
25
27
use rustix:: fs:: MetadataExt ;
26
28
27
29
use fn_error_context:: context;
@@ -228,6 +230,11 @@ const BOOTC_ALEPH_PATH: &str = ".bootc-aleph.json";
228
230
struct InstallAleph {
229
231
/// Digested pull spec for installed image
230
232
image : String ,
233
+ /// The version number
234
+ version : Option < String > ,
235
+ /// The timestamp
236
+ timestamp : Option < chrono:: DateTime < Utc > > ,
237
+ /// The `uname -r` of the kernel doing the installation
231
238
kernel : String ,
232
239
}
233
240
@@ -533,7 +540,7 @@ async fn initialize_ostree_root_from_self(
533
540
let state =
534
541
ostree_container:: deploy:: deploy ( & sysroot, stateroot, & src_imageref, Some ( options) ) . await ?;
535
542
let target_image = target_imgref. to_string ( ) ;
536
- let digest = state. manifest_digest ;
543
+ let digest = state. manifest_digest . as_str ( ) ;
537
544
println ! ( "Installed: {target_image}" ) ;
538
545
println ! ( " Digest: {digest}" ) ;
539
546
@@ -565,8 +572,18 @@ async fn initialize_ostree_root_from_self(
565
572
566
573
let uname = rustix:: system:: uname ( ) ;
567
574
575
+ let config = state. configuration . as_ref ( ) ;
576
+ let labels = config. and_then ( crate :: status:: labels_of_config) ;
577
+ let timestamp = labels
578
+ . and_then ( |l| {
579
+ l. get ( oci_spec:: image:: ANNOTATION_CREATED )
580
+ . map ( |s| s. as_str ( ) )
581
+ } )
582
+ . and_then ( crate :: status:: try_deserialize_timestamp) ;
568
583
let aleph = InstallAleph {
569
584
image : src_imageref. imgref . name . clone ( ) ,
585
+ version : state. version ( ) . as_ref ( ) . map ( |s| s. to_string ( ) ) ,
586
+ timestamp,
570
587
kernel : uname. release ( ) . to_str ( ) ?. to_string ( ) ,
571
588
} ;
572
589
0 commit comments