File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ anstream = "0.6.4"
15
15
anstyle = " 1.0.4"
16
16
anyhow = " 1.0"
17
17
camino = { version = " 1.0.4" , features = [" serde1" ] }
18
- ostree-ext = { version = " 0.12" , git = " https://github.com/ostreedev/ostree-rs-ext/ " }
18
+ ostree-ext = { version = " 0.12.8 " }
19
19
chrono = { version = " 0.4.23" , features = [" serde" ] }
20
20
clap = { version = " 4.2" , features = [" derive" ] }
21
21
clap_mangen = { version = " 0.2" , optional = true }
Original file line number Diff line number Diff line change @@ -122,9 +122,11 @@ pub(crate) async fn pull(
122
122
}
123
123
124
124
pub ( crate ) async fn cleanup ( sysroot : & SysrootLock ) -> Result < ( ) > {
125
+ // We create clones (just atomic reference bumps) here to move to the thread.
125
126
let repo = sysroot. repo ( ) ;
126
127
let sysroot = sysroot. sysroot . clone ( ) ;
127
128
ostree_ext:: tokio_util:: spawn_blocking_cancellable_flatten ( move |cancellable| {
129
+ let locked_sysroot = & SysrootLock :: from_assumed_locked ( & sysroot) ;
128
130
let cancellable = Some ( cancellable) ;
129
131
let repo = & repo;
130
132
let txn = repo. auto_transaction ( cancellable) ?;
@@ -152,6 +154,17 @@ pub(crate) async fn cleanup(sysroot: &SysrootLock) -> Result<()> {
152
154
}
153
155
}
154
156
157
+ let pruned = ostree_container:: deploy:: prune ( locked_sysroot) . context ( "Pruning images" ) ?;
158
+ if !pruned. is_empty ( ) {
159
+ let size = glib:: format_size ( pruned. objsize ) ;
160
+ println ! (
161
+ "Pruned images: {} (layers: {}, objsize: {})" ,
162
+ pruned. n_images, pruned. n_layers, size
163
+ ) ;
164
+ } else {
165
+ tracing:: debug!( "Nothing to prune" ) ;
166
+ }
167
+
155
168
Ok ( ( ) )
156
169
} )
157
170
. await
@@ -219,7 +232,6 @@ pub(crate) async fn stage(
219
232
println ! ( " Version: {version}" ) ;
220
233
}
221
234
println ! ( " Digest: {}" , image. manifest_digest) ;
222
- ostree_container:: deploy:: remove_undeployed_images ( sysroot) . context ( "Pruning images" ) ?;
223
235
224
236
Ok ( ( ) )
225
237
}
You can’t perform that action at this time.
0 commit comments