@@ -567,7 +567,7 @@ func newLayerOperationErr(format string, a ...any) *serror.Generic {
567567 return serror .NewGeneric (fmt .Errorf (format , a ... ), ociv1 .OCILayerOperationFailedReason )
568568}
569569
570- func (r * OCIRepositoryReconciler ) fetchArtifact (obj * ociv1.OCIRepository , metadata * sourcev1.Artifact , ref name.Reference , desc * remote.Descriptor , options remoteOptions ) (io.ReadCloser , * serror.Generic ) {
570+ func (r * OCIRepositoryReconciler ) fetchArtifact (obj * ociv1.OCIRepository , metadata * sourcev1.Artifact , ref name.Reference , desc * remote.Descriptor , options []remote. Option ) (io.ReadCloser , * serror.Generic ) {
571571 switch mt := desc .MediaType ; {
572572 case mt .IsImage ():
573573 // Pull artifact from the remote container registry
@@ -648,7 +648,7 @@ func (r *OCIRepositoryReconciler) fetchArtifact(obj *ociv1.OCIRepository, metada
648648 }
649649}
650650
651- func (r * OCIRepositoryReconciler ) getDescriptor (ref name.Reference , options remoteOptions ) (* remote.Descriptor , error ) {
651+ func (r * OCIRepositoryReconciler ) getDescriptor (ref name.Reference , options []remote. Option ) (* remote.Descriptor , error ) {
652652 // NB: there is no good enought reason to use remote.Head first,
653653 // as it's only in error case that remote.Get won't have to be
654654 // done afterwards anyway
@@ -662,7 +662,7 @@ func (r *OCIRepositoryReconciler) getDescriptor(ref name.Reference, options remo
662662
663663// getRevision fetches the upstream digest, returning the revision in the
664664// format '<tag>@<digest>'.
665- func (r * OCIRepositoryReconciler ) getRevision (ref name.Reference , options remoteOptions ) (string , name.Reference , * remote.Descriptor , error ) {
665+ func (r * OCIRepositoryReconciler ) getRevision (ref name.Reference , options []remote. Option ) (string , name.Reference , * remote.Descriptor , error ) {
666666 switch ref := ref .(type ) {
667667 case name.Digest :
668668 digest , err := gcrv1 .NewHash (ref .DigestStr ())
@@ -1246,26 +1246,22 @@ func (r *OCIRepositoryReconciler) notify(ctx context.Context, oldObj, newObj *oc
12461246// makeRemoteOptions returns a remoteOptions struct with the authentication and transport options set.
12471247// The returned struct can be used to interact with a remote registry using go-containerregistry based libraries.
12481248func makeRemoteOptions (ctxTimeout context.Context , transport http.RoundTripper ,
1249- keychain authn.Keychain , auth authn.Authenticator ) remoteOptions {
1249+ keychain authn.Keychain , auth authn.Authenticator ) []remote. Option {
12501250
12511251 authOption := remote .WithAuthFromKeychain (keychain )
12521252 if auth != nil {
12531253 // auth take precedence over keychain here as we expect the caller to set
12541254 // the auth only if it is required.
12551255 authOption = remote .WithAuth (auth )
12561256 }
1257- return remoteOptions {
1257+ return []remote. Option {
12581258 remote .WithContext (ctxTimeout ),
12591259 remote .WithUserAgent (oci .UserAgent ),
12601260 remote .WithTransport (transport ),
12611261 authOption ,
12621262 }
12631263}
12641264
1265- // remoteOptions contains the options to interact with a remote registry.
1266- // It can be used to pass options to go-containerregistry based libraries.
1267- type remoteOptions []remote.Option
1268-
12691265// ociContentConfigChanged evaluates the current spec with the observations
12701266// of the artifact in the status to determine if artifact content configuration
12711267// has changed and requires rebuilding the artifact.
0 commit comments