@@ -95,7 +95,7 @@ func (simpleCredentialStore) SetRefreshToken(*url.URL, string, string) {}
9595// GetNotaryRepository returns a NotaryRepository which stores all the
9696// information needed to operate on a notary repository.
9797// It creates an HTTP transport providing authentication support.
98- func GetNotaryRepository (in io.Reader , out io.Writer , userAgent string , repoInfo * registry. RepositoryInfo , authConfig * registrytypes.AuthConfig , actions ... string ) (client.Repository , error ) {
98+ func GetNotaryRepository (in io.Reader , out io.Writer , userAgent string , repoInfo * RepositoryInfo , authConfig * registrytypes.AuthConfig , actions ... string ) (client.Repository , error ) {
9999 server , err := Server (repoInfo .Index )
100100 if err != nil {
101101 return nil , err
@@ -304,11 +304,18 @@ type ImageRefAndAuth struct {
304304 original string
305305 authConfig * registrytypes.AuthConfig
306306 reference reference.Named
307- repoInfo * registry. RepositoryInfo
307+ repoInfo * RepositoryInfo
308308 tag string
309309 digest digest.Digest
310310}
311311
312+ // RepositoryInfo describes a repository
313+ type RepositoryInfo struct {
314+ Name reference.Named
315+ // Index points to registry information
316+ Index * registrytypes.IndexInfo
317+ }
318+
312319// GetImageReferencesAndAuth retrieves the necessary reference and auth information for an image name
313320// as an ImageRefAndAuth struct
314321func GetImageReferencesAndAuth (ctx context.Context ,
@@ -321,15 +328,18 @@ func GetImageReferencesAndAuth(ctx context.Context,
321328 }
322329
323330 // Resolve the Repository name from fqn to RepositoryInfo
324- repoInfo := registry .ParseRepositoryInfo (ref )
325- authConfig := authResolver (ctx , repoInfo . Index )
331+ indexInfo := registry .NewIndexInfo (ref )
332+ authConfig := authResolver (ctx , indexInfo )
326333 return ImageRefAndAuth {
327334 original : imgName ,
328335 authConfig : & authConfig ,
329336 reference : ref ,
330- repoInfo : repoInfo ,
331- tag : getTag (ref ),
332- digest : getDigest (ref ),
337+ repoInfo : & RepositoryInfo {
338+ Name : reference .TrimNamed (ref ),
339+ Index : indexInfo ,
340+ },
341+ tag : getTag (ref ),
342+ digest : getDigest (ref ),
333343 }, nil
334344}
335345
@@ -366,7 +376,7 @@ func (imgRefAuth *ImageRefAndAuth) Reference() reference.Named {
366376}
367377
368378// RepoInfo returns the repository information for a given ImageRefAndAuth
369- func (imgRefAuth * ImageRefAndAuth ) RepoInfo () * registry. RepositoryInfo {
379+ func (imgRefAuth * ImageRefAndAuth ) RepoInfo () * RepositoryInfo {
370380 return imgRefAuth .repoInfo
371381}
372382
0 commit comments