@@ -38,12 +38,16 @@ enum WorkflowTemplateParsingError {
3838 MalformParameterSchema ( #[ from] serde_json:: Error ) ,
3939}
4040
41+ /// Information about where the template is stored
4142#[ derive( Debug , Serialize , Deserialize , Default , Clone , SimpleObject , Eq , PartialEq ) ]
4243struct GitHubPath {
44+ /// The path to the template within the repository
4345 path : String ,
4446 #[ serde( rename = "repoURL" ) ]
47+ /// The URL of the GitHub repository
4548 repo_url : String ,
4649 #[ serde( rename = "targetRevision" ) ]
50+ /// The current tracked branch of the repository
4751 target_revision : String ,
4852}
4953
@@ -116,6 +120,7 @@ impl WorkflowTemplate {
116120 Ok ( UiSchema :: new ( & self . metadata . annotations ) ?. map ( Json ) )
117121 }
118122
123+ /// Information about the location of the template
119124 async fn template_url ( & self ) -> Result < GitHubPath , WorkflowTemplateParsingError > {
120125 let instance = match self . metadata . labels . get ( "argocd.argoproj.io/instance" ) {
121126 Some ( val) => val,
@@ -130,15 +135,15 @@ impl WorkflowTemplate {
130135 & ApiResource :: from_gvk_with_plural ( & gvk, "applications" ) ,
131136 ) ;
132137
133- let obj = api. get ( & instance) . await . unwrap ( ) ;
138+ let obj = api. get ( instance) . await . unwrap ( ) ;
134139 let group_annotations = obj. metadata . annotations . clone ( ) . unwrap_or_default ( ) ;
135140 let last_config =
136141 match group_annotations. get ( "kubectl.kubernetes.io/last-applied-configuration" ) {
137142 Some ( s) => s,
138143 None => "" ,
139144 } ;
140145
141- let last_config_val: Value = serde_json:: from_str ( & last_config) ?;
146+ let last_config_val: Value = serde_json:: from_str ( last_config) ?;
142147 let source: GitHubPath = match last_config_val. get ( "spec" ) {
143148 Some ( val) => match val. get ( "source" ) {
144149 Some ( src) => serde_json:: from_value ( src. clone ( ) ) . unwrap ( ) ,
0 commit comments