@@ -2376,22 +2376,31 @@ func TestHelmChartReconciler_reconcileSourceFromOCI_authStrategy(t *testing.T) {
2376
2376
},
2377
2377
},
2378
2378
{
2379
- name : "HTTPS With CA cert" ,
2379
+ name : "HTTPS With CA cert only " ,
2380
2380
want : sreconcile .ResultSuccess ,
2381
2381
registryOpts : registryOptions {
2382
- withTLS : true ,
2383
- withClientCertAuth : true ,
2384
- },
2385
- secretOpts : secretOptions {
2386
- username : testRegistryUsername ,
2387
- password : testRegistryPassword ,
2382
+ withTLS : true ,
2388
2383
},
2389
- secret : & corev1.Secret {
2384
+ certSecret : & corev1.Secret {
2390
2385
ObjectMeta : metav1.ObjectMeta {
2391
- Name : "auth -secretref" ,
2386
+ Name : "certs -secretref" ,
2392
2387
},
2393
- Type : corev1 .SecretTypeDockerConfigJson ,
2394
- Data : map [string ][]byte {},
2388
+ Type : corev1 .SecretTypeOpaque ,
2389
+ Data : map [string ][]byte {
2390
+ "ca.crt" : tlsCA ,
2391
+ },
2392
+ },
2393
+ assertConditions : []metav1.Condition {
2394
+ * conditions .TrueCondition (meta .ReconcilingCondition , meta .ProgressingReason , "building artifact: pulled 'helmchart' chart with version '0.1.0'" ),
2395
+ * conditions .UnknownCondition (meta .ReadyCondition , meta .ProgressingReason , "building artifact: pulled 'helmchart' chart with version '0.1.0'" ),
2396
+ },
2397
+ },
2398
+ {
2399
+ name : "HTTPS With CA cert and client cert auth" ,
2400
+ want : sreconcile .ResultSuccess ,
2401
+ registryOpts : registryOptions {
2402
+ withTLS : true ,
2403
+ withClientCertAuth : true ,
2395
2404
},
2396
2405
certSecret : & corev1.Secret {
2397
2406
ObjectMeta : metav1.ObjectMeta {
@@ -2526,8 +2535,12 @@ func TestHelmChartReconciler_reconcileSourceFromOCI_authStrategy(t *testing.T) {
2526
2535
sp := patch .NewSerialPatcher (obj , r .Client )
2527
2536
2528
2537
got , err := r .reconcileSource (ctx , sp , obj , & b )
2529
- g .Expect (err != nil ).To (Equal (tt .wantErr ))
2530
- g .Expect (got ).To (Equal (tt .want ))
2538
+ if tt .wantErr {
2539
+ g .Expect (err ).To (HaveOccurred ())
2540
+ } else {
2541
+ g .Expect (err ).ToNot (HaveOccurred ())
2542
+ g .Expect (got ).To (Equal (tt .want ))
2543
+ }
2531
2544
g .Expect (obj .Status .Conditions ).To (conditions .MatchConditions (tt .assertConditions ))
2532
2545
})
2533
2546
}
0 commit comments