@@ -2,7 +2,7 @@ use std::collections::HashMap;
22
33use serde:: Deserialize ;
44use snafu:: { OptionExt , ResultExt , Snafu } ;
5- use tracing:: debug;
5+ use tracing:: { debug, instrument } ;
66use url:: Url ;
77use urlencoding:: encode;
88
@@ -117,6 +117,8 @@ impl OciUrlExt for Url {
117117 }
118118}
119119
120+ // TODO (@NickLarsenNZ): Look into why a HashMap is used here when the key is inside each entry in the value
121+ #[ instrument]
120122pub async fn get_oci_index < ' a > ( ) -> Result < HashMap < & ' a str , ChartSourceMetadata > , Error > {
121123 let mut source_index_files: HashMap < & str , ChartSourceMetadata > = HashMap :: new ( ) ;
122124
@@ -153,7 +155,10 @@ pub async fn get_oci_index<'a>() -> Result<HashMap<&'a str, ChartSourceMetadata>
153155 . await
154156 . context ( ParseRepositoriesSnafu ) ?;
155157
156- debug ! ( "OCI repos {:?}" , repositories) ;
158+ debug ! (
159+ count = repositories. len( ) ,
160+ "Received response for OCI repositories"
161+ ) ;
157162
158163 for repository in & repositories {
159164 // fetch all artifacts pro operator
@@ -162,7 +167,7 @@ pub async fn get_oci_index<'a>() -> Result<HashMap<&'a str, ChartSourceMetadata>
162167 . split_once ( '/' )
163168 . context ( UnexpectedOciRepositoryNameSnafu ) ?;
164169
165- debug ! ( "OCI repo parts {} and {}" , project_name , repository_name ) ;
170+ tracing :: trace! ( project_name , repository_name , "OCI repository parts" ) ;
166171
167172 let mut artifacts = Vec :: new ( ) ;
168173 let mut page = 1 ;
@@ -196,17 +201,7 @@ pub async fn get_oci_index<'a>() -> Result<HashMap<&'a str, ChartSourceMetadata>
196201 . replace ( "-arm64" , "" )
197202 . replace ( "-amd64" , "" ) ;
198203
199- debug ! (
200- "OCI resolved artifact {}, {}, {}" ,
201- release_version. to_string( ) ,
202- repository_name. to_string( ) ,
203- release_artifact. name. to_string( )
204- ) ;
205-
206- debug ! (
207- "Repo/Artifact/Tag: {:?} / {:?} / {:?}" ,
208- repository, artifact, release_artifact
209- ) ;
204+ tracing:: trace!( repository_name, release_version, "OCI resolved artifact" ) ;
210205
211206 let entry = ChartSourceEntry {
212207 name : repository_name. to_string ( ) ,
0 commit comments