internal/registry: remove RepositoryInfo, add NewIndexInfo
Most places only use IndexInfo (and may not even need that), so replace the use of ParseRepositoryInfo for NewIndexInfo, and move the RepositoryInfo type to the trust package, which uses it as part of its ImageRefAndAuth struct. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -34,8 +34,7 @@ func (r repositoryEndpoint) BaseURL() string {
|
||||
|
||||
func newDefaultRepositoryEndpoint(ref reference.Named, insecure bool) (repositoryEndpoint, error) {
|
||||
repoName := reference.TrimNamed(ref)
|
||||
repoInfo := registry.ParseRepositoryInfo(ref)
|
||||
indexInfo := repoInfo.Index
|
||||
indexInfo := registry.NewIndexInfo(ref)
|
||||
|
||||
endpoint, err := getDefaultEndpoint(ref, !indexInfo.Secure)
|
||||
if err != nil {
|
||||
|
||||
@ -221,8 +221,7 @@ func (c *client) iterateEndpoints(ctx context.Context, namedRef reference.Named,
|
||||
}
|
||||
|
||||
repoName := reference.TrimNamed(namedRef)
|
||||
repoInfo := registry.ParseRepositoryInfo(namedRef)
|
||||
indexInfo := repoInfo.Index
|
||||
indexInfo := registry.NewIndexInfo(namedRef)
|
||||
|
||||
confirmedTLSRegistries := make(map[string]bool)
|
||||
for _, endpoint := range endpoints {
|
||||
@ -285,8 +284,7 @@ func allEndpoints(namedRef reference.Named, insecure bool) ([]registry.APIEndpoi
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
repoInfo := registry.ParseRepositoryInfo(namedRef)
|
||||
endpoints, err := registryService.Endpoints(context.TODO(), reference.Domain(repoInfo.Name))
|
||||
endpoints, err := registryService.Endpoints(context.TODO(), reference.Domain(namedRef))
|
||||
logrus.Debugf("endpoints for %s: %v", namedRef, endpoints)
|
||||
return endpoints, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user