@@ -370,13 +370,12 @@ impl TestContext {
370370 async move {
371371 let deployment = api. get ( & name) . await ?;
372372
373- if let Some ( status) = & deployment. status {
374- if let Some ( available_replicas) = status. available_replicas {
375- if available_replicas == 1 {
376- test_info ! ( & tn, "{} deployment has 1 available replica" , name) ;
377- return Ok ( ( ) ) ;
378- }
379- }
373+ if let Some ( status) = & deployment. status
374+ && let Some ( available_replicas) = status. available_replicas
375+ && available_replicas == 1
376+ {
377+ test_info ! ( & tn, "{} deployment has 1 available replica" , name) ;
378+ return Ok ( ( ) ) ;
380379 }
381380
382381 Err ( anyhow ! (
@@ -485,36 +484,36 @@ impl TestContext {
485484 let ns = self . test_namespace . clone ( ) ;
486485 let sa_src = workspace_root. join ( "config/rbac/service_account.yaml" ) ;
487486 let sa_content = std:: fs:: read_to_string ( & sa_src) ?
488- . replace ( "namespace: system" , & format ! ( "namespace: {}" , ns ) ) ;
487+ . replace ( "namespace: system" , & format ! ( "namespace: {ns}" ) ) ;
489488 let sa_dst = rbac_temp_dir. join ( "service_account.yaml" ) ;
490489 std:: fs:: write ( & sa_dst, sa_content) ?;
491490
492491 let role_path = rbac_temp_dir. join ( "role.yaml" ) ;
493492 let role_content = std:: fs:: read_to_string ( & role_path) ?. replace (
494493 "name: trusted-cluster-operator-role" ,
495- & format ! ( "name: {}-trusted-cluster-operator-role" , ns ) ,
494+ & format ! ( "name: {ns }-trusted-cluster-operator-role" ) ,
496495 ) ;
497496 std:: fs:: write ( & role_path, role_content) ?;
498497
499498 let rb_src = workspace_root. join ( "config/rbac/role_binding.yaml" ) ;
500499 let rb = "name: manager-rolebinding" ;
501500 let role = "name: trusted-cluster-operator-role" ;
502501 let rb_content = std:: fs:: read_to_string ( & rb_src) ?
503- . replace ( rb, & format ! ( "name: {}-manager-rolebinding" , ns ) )
504- . replace ( role, & format ! ( "name: {}-trusted-cluster-operator-role" , ns ) )
505- . replace ( "namespace: system" , & format ! ( "namespace: {}" , ns ) ) ;
502+ . replace ( rb, & format ! ( "name: {ns }-manager-rolebinding" ) )
503+ . replace ( role, & format ! ( "name: {ns }-trusted-cluster-operator-role" ) )
504+ . replace ( "namespace: system" , & format ! ( "namespace: {ns}" ) ) ;
506505 let rb_dst = rbac_temp_dir. join ( "role_binding.yaml" ) ;
507506 std:: fs:: write ( & rb_dst, rb_content) ?;
508507
509508 let le_role_src = workspace_root. join ( "config/rbac/leader_election_role.yaml" ) ;
510509 let le_role_content = std:: fs:: read_to_string ( & le_role_src) ?
511- . replace ( "namespace: system" , & format ! ( "namespace: {}" , ns ) ) ;
510+ . replace ( "namespace: system" , & format ! ( "namespace: {ns}" ) ) ;
512511 let le_role_dst = rbac_temp_dir. join ( "leader_election_role.yaml" ) ;
513512 std:: fs:: write ( & le_role_dst, le_role_content) ?;
514513
515514 let le_rb_src = workspace_root. join ( "config/rbac/leader_election_role_binding.yaml" ) ;
516515 let le_rb_content = std:: fs:: read_to_string ( & le_rb_src) ?
517- . replace ( "namespace: system" , & format ! ( "namespace: {}" , ns ) ) ;
516+ . replace ( "namespace: system" , & format ! ( "namespace: {ns}" ) ) ;
518517 let le_rb_dst = rbac_temp_dir. join ( "leader_election_role_binding.yaml" ) ;
519518 std:: fs:: write ( & le_rb_dst, le_rb_content) ?;
520519
@@ -570,13 +569,13 @@ impl TestContext {
570569 let cr_content = std:: fs:: read_to_string ( & cr_manifest_path) ?;
571570 let mut cr_value: serde_yaml:: Value = serde_yaml:: from_str ( & cr_content) ?;
572571
573- if let Some ( spec) = cr_value. get_mut ( "spec" ) {
574- if let Some ( spec_map) = spec. as_mapping_mut ( ) {
575- spec_map . insert (
576- serde_yaml :: Value :: String ( "publicTrusteeAddr" . to_string ( ) ) ,
577- serde_yaml:: Value :: String ( trustee_addr . clone ( ) ) ,
578- ) ;
579- }
572+ if let Some ( spec) = cr_value. get_mut ( "spec" )
573+ && let Some ( spec_map) = spec. as_mapping_mut ( )
574+ {
575+ spec_map . insert (
576+ serde_yaml:: Value :: String ( "publicTrusteeAddr" . to_string ( ) ) ,
577+ serde_yaml :: Value :: String ( trustee_addr . clone ( ) ) ,
578+ ) ;
580579 }
581580
582581 let updated_content = serde_yaml:: to_string ( & cr_value) ?;
0 commit comments