@@ -567,7 +567,7 @@ func newLayerOperationErr(format string, a ...any) *serror.Generic {
567
567
return serror .NewGeneric (fmt .Errorf (format , a ... ), ociv1 .OCILayerOperationFailedReason )
568
568
}
569
569
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 ) {
571
571
switch mt := desc .MediaType ; {
572
572
case mt .IsImage ():
573
573
// Pull artifact from the remote container registry
@@ -648,7 +648,7 @@ func (r *OCIRepositoryReconciler) fetchArtifact(obj *ociv1.OCIRepository, metada
648
648
}
649
649
}
650
650
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 ) {
652
652
// NB: there is no good enought reason to use remote.Head first,
653
653
// as it's only in error case that remote.Get won't have to be
654
654
// done afterwards anyway
@@ -662,7 +662,7 @@ func (r *OCIRepositoryReconciler) getDescriptor(ref name.Reference, options remo
662
662
663
663
// getRevision fetches the upstream digest, returning the revision in the
664
664
// 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 ) {
666
666
switch ref := ref .(type ) {
667
667
case name.Digest :
668
668
digest , err := gcrv1 .NewHash (ref .DigestStr ())
@@ -1246,26 +1246,22 @@ func (r *OCIRepositoryReconciler) notify(ctx context.Context, oldObj, newObj *oc
1246
1246
// makeRemoteOptions returns a remoteOptions struct with the authentication and transport options set.
1247
1247
// The returned struct can be used to interact with a remote registry using go-containerregistry based libraries.
1248
1248
func makeRemoteOptions (ctxTimeout context.Context , transport http.RoundTripper ,
1249
- keychain authn.Keychain , auth authn.Authenticator ) remoteOptions {
1249
+ keychain authn.Keychain , auth authn.Authenticator ) []remote. Option {
1250
1250
1251
1251
authOption := remote .WithAuthFromKeychain (keychain )
1252
1252
if auth != nil {
1253
1253
// auth take precedence over keychain here as we expect the caller to set
1254
1254
// the auth only if it is required.
1255
1255
authOption = remote .WithAuth (auth )
1256
1256
}
1257
- return remoteOptions {
1257
+ return []remote. Option {
1258
1258
remote .WithContext (ctxTimeout ),
1259
1259
remote .WithUserAgent (oci .UserAgent ),
1260
1260
remote .WithTransport (transport ),
1261
1261
authOption ,
1262
1262
}
1263
1263
}
1264
1264
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
-
1269
1265
// ociContentConfigChanged evaluates the current spec with the observations
1270
1266
// of the artifact in the status to determine if artifact content configuration
1271
1267
// has changed and requires rebuilding the artifact.
0 commit comments