@@ -48,11 +48,11 @@ func (p *mockPreAuthorizer) PreAuthorize(
48
48
return p .missingRules , p .returnError
49
49
}
50
50
51
- func (mp * mockPreflight ) Install (context.Context , * release. Release ) error {
51
+ func (mp * mockPreflight ) Install (context.Context , []client. Object ) error {
52
52
return mp .installErr
53
53
}
54
54
55
- func (mp * mockPreflight ) Upgrade (context.Context , * release. Release ) error {
55
+ func (mp * mockPreflight ) Upgrade (context.Context , []client. Object ) error {
56
56
return mp .upgradeErr
57
57
}
58
58
@@ -248,9 +248,10 @@ func TestApply_Installation(t *testing.T) {
248
248
}
249
249
mockPf := & mockPreflight {installErr : errors .New ("failed during install pre-flight check" )}
250
250
helmApplier := applier.Helm {
251
- ActionClientGetter : mockAcg ,
252
- Preflights : []applier.Preflight {mockPf },
253
- BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
251
+ ActionClientGetter : mockAcg ,
252
+ Preflights : []applier.Preflight {mockPf },
253
+ BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
254
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
254
255
}
255
256
256
257
objs , state , err := helmApplier .Apply (context .TODO (), validFS , testCE , testObjectLabels , testStorageLabels )
@@ -266,8 +267,9 @@ func TestApply_Installation(t *testing.T) {
266
267
installErr : errors .New ("failed installing chart" ),
267
268
}
268
269
helmApplier := applier.Helm {
269
- ActionClientGetter : mockAcg ,
270
- BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
270
+ ActionClientGetter : mockAcg ,
271
+ BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
272
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
271
273
}
272
274
273
275
objs , state , err := helmApplier .Apply (context .TODO (), validFS , testCE , testObjectLabels , testStorageLabels )
@@ -286,8 +288,9 @@ func TestApply_Installation(t *testing.T) {
286
288
},
287
289
}
288
290
helmApplier := applier.Helm {
289
- ActionClientGetter : mockAcg ,
290
- BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
291
+ ActionClientGetter : mockAcg ,
292
+ BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
293
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
291
294
}
292
295
293
296
objs , state , err := helmApplier .Apply (context .TODO (), validFS , testCE , testObjectLabels , testStorageLabels )
@@ -328,10 +331,11 @@ func TestApply_InstallationWithPreflightPermissionsEnabled(t *testing.T) {
328
331
}
329
332
mockPf := & mockPreflight {installErr : errors .New ("failed during install pre-flight check" )}
330
333
helmApplier := applier.Helm {
331
- ActionClientGetter : mockAcg ,
332
- Preflights : []applier.Preflight {mockPf },
333
- PreAuthorizer : & mockPreAuthorizer {nil , nil },
334
- BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
334
+ ActionClientGetter : mockAcg ,
335
+ Preflights : []applier.Preflight {mockPf },
336
+ PreAuthorizer : & mockPreAuthorizer {nil , nil },
337
+ BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
338
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
335
339
}
336
340
337
341
objs , state , err := helmApplier .Apply (context .TODO (), validFS , testCE , testObjectLabels , testStorageLabels )
@@ -408,9 +412,10 @@ func TestApply_InstallationWithPreflightPermissionsEnabled(t *testing.T) {
408
412
},
409
413
}
410
414
helmApplier := applier.Helm {
411
- ActionClientGetter : mockAcg ,
412
- PreAuthorizer : & mockPreAuthorizer {nil , nil },
413
- BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
415
+ ActionClientGetter : mockAcg ,
416
+ PreAuthorizer : & mockPreAuthorizer {nil , nil },
417
+ BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
418
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
414
419
}
415
420
416
421
// Use a ClusterExtension with valid Spec fields.
@@ -464,9 +469,10 @@ func TestApply_Upgrade(t *testing.T) {
464
469
}
465
470
mockPf := & mockPreflight {upgradeErr : errors .New ("failed during upgrade pre-flight check" )}
466
471
helmApplier := applier.Helm {
467
- ActionClientGetter : mockAcg ,
468
- Preflights : []applier.Preflight {mockPf },
469
- BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
472
+ ActionClientGetter : mockAcg ,
473
+ Preflights : []applier.Preflight {mockPf },
474
+ BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
475
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
470
476
}
471
477
472
478
objs , state , err := helmApplier .Apply (context .TODO (), validFS , testCE , testObjectLabels , testStorageLabels )
@@ -488,7 +494,8 @@ func TestApply_Upgrade(t *testing.T) {
488
494
mockPf := & mockPreflight {}
489
495
helmApplier := applier.Helm {
490
496
ActionClientGetter : mockAcg , Preflights : []applier.Preflight {mockPf },
491
- BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
497
+ BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
498
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
492
499
}
493
500
494
501
objs , state , err := helmApplier .Apply (context .TODO (), validFS , testCE , testObjectLabels , testStorageLabels )
@@ -509,9 +516,10 @@ func TestApply_Upgrade(t *testing.T) {
509
516
}
510
517
mockPf := & mockPreflight {}
511
518
helmApplier := applier.Helm {
512
- ActionClientGetter : mockAcg ,
513
- Preflights : []applier.Preflight {mockPf },
514
- BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
519
+ ActionClientGetter : mockAcg ,
520
+ Preflights : []applier.Preflight {mockPf },
521
+ BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
522
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
515
523
}
516
524
517
525
objs , state , err := helmApplier .Apply (context .TODO (), validFS , testCE , testObjectLabels , testStorageLabels )
@@ -530,8 +538,9 @@ func TestApply_Upgrade(t *testing.T) {
530
538
desiredRel : & testDesiredRelease ,
531
539
}
532
540
helmApplier := applier.Helm {
533
- ActionClientGetter : mockAcg ,
534
- BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
541
+ ActionClientGetter : mockAcg ,
542
+ BundleToHelmChartConverter : & convert.BundleToHelmChartConverter {},
543
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
535
544
}
536
545
537
546
objs , state , err := helmApplier .Apply (context .TODO (), validFS , testCE , testObjectLabels , testStorageLabels )
@@ -562,6 +571,7 @@ func TestApply_InstallationWithSingleOwnNamespaceInstallSupportEnabled(t *testin
562
571
return nil , nil
563
572
},
564
573
},
574
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
565
575
}
566
576
567
577
testExt := & ocv1.ClusterExtension {
@@ -595,6 +605,7 @@ func TestApply_RegistryV1ToChartConverterIntegration(t *testing.T) {
595
605
return nil , nil
596
606
},
597
607
},
608
+ HelmReleaseToObjectsConverter : applier.HelmReleaseToObjectsConverter {Mock : true },
598
609
}
599
610
600
611
_ , _ , _ = helmApplier .Apply (context .TODO (), validFS , testCE , testObjectLabels , testStorageLabels )
0 commit comments