File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -312,16 +312,15 @@ pub async fn reap_containers(
312312 . clone ( ) ,
313313 status : RemovalStatus :: Eligible ,
314314 } ) ;
315- if config. reap_networks {
316- if let Some ( network_settings) = container. network_settings {
317- if let Some ( networks) = network_settings. networks {
318- // Docker has network IDs, but also requires each network to have a unique
319- // name. We just use the name as an ID since it's easier to retrieve.
320- eligible_network_names. extend ( networks. keys ( ) . cloned ( ) . inspect ( |name| {
321- debug ! ( "Added network {} from container {} " , name, id) ;
322- } ) )
323- }
324- }
315+ if config. reap_networks
316+ && let Some ( network_settings) = container. network_settings
317+ && let Some ( networks) = network_settings. networks
318+ {
319+ // Docker has network IDs, but also requires each network to have a unique
320+ // name. We just use the name as an ID since it's easier to retrieve.
321+ eligible_network_names. extend ( networks. keys ( ) . cloned ( ) . inspect ( |name| {
322+ debug ! ( "Added network {} from container {} " , name, id) ;
323+ } ) )
325324 }
326325 }
327326 for network_name in eligible_network_names {
You can’t perform that action at this time.
0 commit comments