@@ -43,9 +43,9 @@ import (
4343 "github.com/notaryproject/notation-go/signer"
4444 "github.com/notaryproject/notation-go/verifier/trustpolicy"
4545 . "github.com/onsi/gomega"
46- coptions "github.com/sigstore/cosign/v2 /cmd/cosign/cli/options"
47- "github.com/sigstore/cosign/v2 /cmd/cosign/cli/sign"
48- "github.com/sigstore/cosign/v2 /pkg/cosign"
46+ coptions "github.com/sigstore/cosign/v3 /cmd/cosign/cli/options"
47+ "github.com/sigstore/cosign/v3 /cmd/cosign/cli/sign"
48+ "github.com/sigstore/cosign/v3 /pkg/cosign"
4949 hchart "helm.sh/helm/v4/pkg/chart/v2"
5050 "helm.sh/helm/v4/pkg/chart/v2/loader"
5151 helmreg "helm.sh/helm/v4/pkg/registry"
@@ -111,9 +111,10 @@ func TestHelmChartReconciler_deleteBeforeFinalizer(t *testing.T) {
111111 g .Expect (k8sClient .Delete (ctx , helmchart )).NotTo (HaveOccurred ())
112112
113113 r := & HelmChartReconciler {
114- Client : k8sClient ,
115- EventRecorder : record .NewFakeRecorder (32 ),
116- Storage : testStorage ,
114+ Client : k8sClient ,
115+ EventRecorder : record .NewFakeRecorder (32 ),
116+ Storage : testStorage ,
117+ CosignVerifierFactory : testCosignVerifierFactory ,
117118 }
118119 // NOTE: Only a real API server responds with an error in this scenario.
119120 _ , err := r .Reconcile (ctx , ctrl.Request {NamespacedName : client .ObjectKeyFromObject (helmchart )})
@@ -792,10 +793,11 @@ func TestHelmChartReconciler_reconcileSource(t *testing.T) {
792793 }
793794
794795 r := & HelmChartReconciler {
795- Client : clientBuilder .Build (),
796- EventRecorder : record .NewFakeRecorder (32 ),
797- Storage : st ,
798- patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
796+ Client : clientBuilder .Build (),
797+ EventRecorder : record .NewFakeRecorder (32 ),
798+ Storage : st ,
799+ CosignVerifierFactory : testCosignVerifierFactory ,
800+ patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
799801 }
800802
801803 obj := sourcev1.HelmChart {
@@ -1128,11 +1130,12 @@ func TestHelmChartReconciler_buildFromHelmRepository(t *testing.T) {
11281130 g .Expect (err ).ToNot (HaveOccurred ())
11291131
11301132 r := & HelmChartReconciler {
1131- Client : clientBuilder .Build (),
1132- EventRecorder : record .NewFakeRecorder (32 ),
1133- Getters : testGetters ,
1134- Storage : testStorage ,
1135- patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
1133+ Client : clientBuilder .Build (),
1134+ EventRecorder : record .NewFakeRecorder (32 ),
1135+ Getters : testGetters ,
1136+ Storage : testStorage ,
1137+ CosignVerifierFactory : testCosignVerifierFactory ,
1138+ patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
11361139 }
11371140
11381141 repository := & sourcev1.HelmRepository {
@@ -1380,11 +1383,12 @@ func TestHelmChartReconciler_buildFromOCIHelmRepository(t *testing.T) {
13801383 }
13811384
13821385 r := & HelmChartReconciler {
1383- Client : clientBuilder .Build (),
1384- EventRecorder : record .NewFakeRecorder (32 ),
1385- Getters : testGetters ,
1386- Storage : st ,
1387- patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
1386+ Client : clientBuilder .Build (),
1387+ EventRecorder : record .NewFakeRecorder (32 ),
1388+ Getters : testGetters ,
1389+ Storage : st ,
1390+ CosignVerifierFactory : testCosignVerifierFactory ,
1391+ patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
13881392 }
13891393
13901394 repository := & sourcev1.HelmRepository {
@@ -1907,8 +1911,9 @@ func TestHelmChartReconciler_getSource(t *testing.T) {
19071911 WithObjects (mocks ... )
19081912
19091913 r := & HelmChartReconciler {
1910- Client : clientBuilder .Build (),
1911- patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
1914+ Client : clientBuilder .Build (),
1915+ CosignVerifierFactory : testCosignVerifierFactory ,
1916+ patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
19121917 }
19131918
19141919 tests := []struct {
@@ -2023,9 +2028,10 @@ func TestHelmChartReconciler_reconcileDelete(t *testing.T) {
20232028 g := NewWithT (t )
20242029
20252030 r := & HelmChartReconciler {
2026- EventRecorder : record .NewFakeRecorder (32 ),
2027- Storage : testStorage ,
2028- patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
2031+ EventRecorder : record .NewFakeRecorder (32 ),
2032+ Storage : testStorage ,
2033+ CosignVerifierFactory : testCosignVerifierFactory ,
2034+ patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
20292035 }
20302036
20312037 obj := & sourcev1.HelmChart {
@@ -2163,7 +2169,8 @@ func TestHelmChartReconciler_reconcileSubRecs(t *testing.T) {
21632169 WithScheme (testEnv .GetScheme ()).
21642170 WithStatusSubresource (& sourcev1.HelmChart {}).
21652171 Build (),
2166- patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
2172+ CosignVerifierFactory : testCosignVerifierFactory ,
2173+ patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
21672174 }
21682175 obj := & sourcev1.HelmChart {
21692176 ObjectMeta : metav1.ObjectMeta {
@@ -2877,11 +2884,12 @@ func TestHelmChartRepository_reconcileSource_verifyOCISourceSignature_keyless(t
28772884 clientBuilder .WithObjects (repository )
28782885
28792886 r := & HelmChartReconciler {
2880- Client : clientBuilder .Build (),
2881- EventRecorder : record .NewFakeRecorder (32 ),
2882- Getters : testGetters ,
2883- Storage : testStorage ,
2884- patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
2887+ Client : clientBuilder .Build (),
2888+ EventRecorder : record .NewFakeRecorder (32 ),
2889+ Getters : testGetters ,
2890+ Storage : testStorage ,
2891+ CosignVerifierFactory : testCosignVerifierFactory ,
2892+ patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
28852893 }
28862894
28872895 obj := & sourcev1.HelmChart {
@@ -3182,11 +3190,12 @@ func TestHelmChartReconciler_reconcileSourceFromOCI_verifySignatureNotation(t *t
31823190 clientBuilder .WithObjects (repository , secret , caSecret )
31833191
31843192 r := & HelmChartReconciler {
3185- Client : clientBuilder .Build (),
3186- EventRecorder : record .NewFakeRecorder (32 ),
3187- Getters : testGetters ,
3188- Storage : st ,
3189- patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
3193+ Client : clientBuilder .Build (),
3194+ EventRecorder : record .NewFakeRecorder (32 ),
3195+ Getters : testGetters ,
3196+ Storage : testStorage ,
3197+ CosignVerifierFactory : testCosignVerifierFactory ,
3198+ patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
31903199 }
31913200
31923201 obj := & sourcev1.HelmChart {
@@ -3433,11 +3442,12 @@ func TestHelmChartReconciler_reconcileSourceFromOCI_verifySignatureCosign(t *tes
34333442 clientBuilder .WithObjects (repository , secret )
34343443
34353444 r := & HelmChartReconciler {
3436- Client : clientBuilder .Build (),
3437- EventRecorder : record .NewFakeRecorder (32 ),
3438- Getters : testGetters ,
3439- Storage : st ,
3440- patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
3445+ Client : clientBuilder .Build (),
3446+ EventRecorder : record .NewFakeRecorder (32 ),
3447+ Getters : testGetters ,
3448+ Storage : st ,
3449+ CosignVerifierFactory : testCosignVerifierFactory ,
3450+ patchOptions : getPatchOptions (helmChartReadyCondition .Owned , "sc" ),
34413451 }
34423452
34433453 obj := & sourcev1.HelmChart {
@@ -3468,7 +3478,7 @@ func TestHelmChartReconciler_reconcileSourceFromOCI_verifySignatureCosign(t *tes
34683478 Timeout : timeout ,
34693479 }
34703480
3471- err = sign .SignCmd (ro , ko , coptions.SignOptions {
3481+ err = sign .SignCmd (ctx , ro , ko , coptions.SignOptions {
34723482 Upload : true ,
34733483 SkipConfirmation : true ,
34743484 TlogUpload : false ,
0 commit comments