@@ -1201,6 +1201,7 @@ secret:
12011201 }
12021202
12031203 #[ test]
1204+ #[ allow( clippy:: too_many_lines) ]
12041205 fn test_git_sync_ca_cert ( ) {
12051206 let git_sync_spec = r#"
12061207 # GitSync using SSH
@@ -1324,7 +1325,7 @@ volumeMounts:
13241325 assert_eq ! ( 1 , git_sync_resources. git_sync_init_containers. len( ) ) ;
13251326
13261327 assert_eq ! (
1327- r# "args:
1328+ r"args:
13281329- |-
13291330 mkdir --parents /stackable/log/git-sync-0-init && exec > >(tee /stackable/log/git-sync-0-init/container.stdout.log) 2> >(tee /stackable/log/git-sync-0-init/container.stderr.log >&2)
13301331 /stackable/git-sync --depth=3 --git-config='http.sslCAInfo:/stackable/gitca-0/ca.crt,safe.directory:/tmp/git' --link=current --one-time=true --period=60s --ref=trunk --repo=ssh://git@github.com/stackabletech/repo.git --rev=HEAD --root=/tmp/git
@@ -1356,7 +1357,7 @@ volumeMounts:
13561357 name: extra-volume
13571358- mountPath: /stackable/gitca-0
13581359 name: ca-cert-0
1359- "# ,
1360+ " ,
13601361 serde_yaml:: to_string( & git_sync_resources. git_sync_init_containers. first( ) ) . unwrap( )
13611362 ) ;
13621363
@@ -1414,109 +1415,109 @@ name: ca-cert-0
14141415 // https with tls/null --> deactivate: Ok
14151416 #[ case(
14161417 "https://github.com/stackabletech/repo1" ,
1417- r# "
1418+ "
14181419 tls: null
1419- "# ,
1420+ " ,
14201421 true
14211422 ) ]
14221423 // https with no tls --> defaults to webPki: Ok
14231424 #[ case(
14241425 "https://github.com/stackabletech/repo1" ,
1425- r# "
1426- "# ,
1426+ "
1427+ " ,
14271428 true
14281429 ) ]
14291430 // http with no tls --> defaults to webPki: Error
14301431 #[ case(
14311432 "http://github.com/stackabletech/repo1" ,
1432- r# "
1433- "# ,
1433+ "
1434+ " ,
14341435 false
14351436 ) ]
14361437 // https with tls/None: Ok
14371438 #[ case(
14381439 "https://github.com/stackabletech/repo1" ,
1439- r# "
1440+ "
14401441 tls:
14411442 verification:
14421443 none: {}
1443- "# ,
1444+ " ,
14441445 true
14451446 ) ]
14461447 // https with tls/None: Error
14471448 #[ case(
14481449 "http://github.com/stackabletech/repo1" ,
1449- r# "
1450+ "
14501451 tls:
1451- "# ,
1452+ " ,
14521453 true
14531454 ) ]
14541455 // ssh with tls/secret: Ok
14551456 #[ case(
14561457 "ssh://git@github.com/stackabletech/repo.git" ,
1457- r# "
1458+ "
14581459 tls:
14591460 verification:
14601461 server:
14611462 caCert:
14621463 secretClass: git-tls-ca
1463- "# ,
1464+ " ,
14641465 true
14651466 ) ]
14661467 // https with tls/secret: Ok
14671468 #[ case(
14681469 "https://github.com/stackabletech/repo1" ,
1469- r# "
1470+ "
14701471 tls:
14711472 verification:
14721473 server:
14731474 caCert:
14741475 secretClass: another-ca
1475- "# ,
1476+ " ,
14761477 true
14771478 ) ]
14781479 // https with tls/webPki: Ok
14791480 #[ case(
14801481 "https://github.com/stackabletech/repo1" ,
1481- r# "
1482+ "
14821483 tls:
14831484 verification:
14841485 server:
14851486 caCert:
14861487 webPki: {}
1487- "# ,
1488+ " ,
14881489 true
14891490 ) ]
14901491 // http with tls/webPki: Error
14911492 #[ case(
14921493 "http://github.com/stackabletech/repo1" ,
1493- r# "
1494+ "
14941495 tls:
14951496 verification:
14961497 server:
14971498 caCert:
14981499 webPki: {}
1499- "# ,
1500+ " ,
15001501 false
15011502 ) ]
15021503 // http with tls/secret: Error
15031504 #[ case(
15041505 "http://github.com/stackabletech/repo1" ,
1505- r# "
1506+ "
15061507 tls:
15071508 verification:
15081509 server:
15091510 caCert:
15101511 secretClass: http-ca
1511- "# ,
1512+ " ,
15121513 false
15131514 ) ]
15141515 fn test_git_sync_tls_scheme ( #[ case] repo : & str , #[ case] tls : & str , #[ case] expect_ok : bool ) {
15151516 let git_sync_spec = format ! (
1516- r# "
1517+ "
15171518- repo: {repo}
15181519 {tls}
1519- "#
1520+ "
15201521 ) ;
15211522
15221523 let git_syncs: Vec < GitSync > = yaml_from_str_singleton_map ( & git_sync_spec) . unwrap ( ) ;
0 commit comments