Skip to content

Commit ca2662d

Browse files
refactor(notation): trustStore -> trustPolicy
Signed-off-by: Jason <[email protected]>
1 parent 6765792 commit ca2662d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

internal/controller/helmchart_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ func (r *HelmChartReconciler) makeVerifiers(ctx context.Context, obj *helmv1.Hel
14181418

14191419
trustPolicy := notation.CleanTrustPolicy(&doc, ctrl.LoggerFrom(ctx))
14201420
defaultNotationOciOpts := []notation.Options{
1421-
notation.WithTrustStore(trustPolicy),
1421+
notation.WithTrustPolicy(trustPolicy),
14221422
notation.WithRemoteOptions(verifyOpts...),
14231423
notation.WithAuth(clientOpts.Authenticator),
14241424
notation.WithKeychain(clientOpts.Keychain),

internal/controller/ocirepository_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ func (r *OCIRepositoryReconciler) verifySignature(ctx context.Context, obj *ociv
743743

744744
trustPolicy := notation.CleanTrustPolicy(&doc, ctrl.LoggerFrom(ctx))
745745
defaultNotationOciOpts := []notation.Options{
746-
notation.WithTrustStore(trustPolicy),
746+
notation.WithTrustPolicy(trustPolicy),
747747
notation.WithRemoteOptions(opt...),
748748
notation.WithAuth(auth),
749749
notation.WithKeychain(keychain),

internal/oci/notation/notation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ func WithInsecureRegistry(insecure bool) Options {
6868
}
6969
}
7070

71-
// WithTrustStore sets the trust store configuration.
72-
func WithTrustStore(trustStore *trustpolicy.Document) Options {
71+
// WithTrustPolicy sets the trust policy configuration.
72+
func WithTrustPolicy(trustPolicy *trustpolicy.Document) Options {
7373
return func(opts *options) {
74-
opts.trustPolicy = trustStore
74+
opts.trustPolicy = trustPolicy
7575
}
7676
}
7777

internal/oci/notation/notation_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func TestOptions(t *testing.T) {
107107
},
108108
{
109109
name: "truststore, empty document",
110-
opts: []Options{WithTrustStore(&trustpolicy.Document{})},
110+
opts: []Options{WithTrustPolicy(&trustpolicy.Document{})},
111111
want: &options{
112112
rootCertificates: nil,
113113
rOpt: nil,
@@ -116,7 +116,7 @@ func TestOptions(t *testing.T) {
116116
},
117117
{
118118
name: "truststore, dummy document",
119-
opts: []Options{WithTrustStore(dummyPolicyDocument())},
119+
opts: []Options{WithTrustPolicy(dummyPolicyDocument())},
120120
want: &options{
121121
rootCertificates: nil,
122122
rOpt: nil,

0 commit comments

Comments
 (0)