@@ -31,7 +31,7 @@ use std::collections::HashMap;
31
31
use std:: convert:: TryFrom ;
32
32
use tokio:: io:: { AsyncRead , AsyncWrite , AsyncWriteExt } ;
33
33
use tokio_util:: compat:: FuturesAsyncReadCompatExt ;
34
- use tracing:: { debug, trace, warn} ;
34
+ use tracing:: { debug, error , trace, warn} ;
35
35
36
36
const MIME_TYPES_DISTRIBUTION_MANIFEST : & [ & str ] = & [
37
37
IMAGE_MANIFEST_MEDIA_TYPE ,
@@ -281,7 +281,7 @@ impl Client {
281
281
self . validate_layers ( & manifest, accepted_media_types)
282
282
. await ?;
283
283
284
- let layers = stream:: iter ( & manifest. layers )
284
+ let layers = stream:: iter ( manifest. layers . clone ( ) )
285
285
. map ( |layer| {
286
286
// This avoids moving `self` which is &mut Self
287
287
// into the async block. We only want to capture
@@ -504,7 +504,10 @@ impl Client {
504
504
}
505
505
_ => {
506
506
let reason = auth_res. text ( ) . await ?;
507
- debug ! ( "Failed to authenticate for image '{:?}': {}" , image, reason) ;
507
+ let query_str = query
508
+ . iter ( )
509
+ . fold ( String :: new ( ) , |a, ( k, v) | format ! ( "{}&{}={}" , a, k, v) ) ;
510
+ error ! ( realm, query = query_str, image = ?image, reason, "Failed to authenticate for image" ) ;
508
511
Err ( OciDistributionError :: AuthenticationFailure ( reason) )
509
512
}
510
513
}
0 commit comments