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:
Sebastiaan van Stijn
2025-08-03 14:39:30 +02:00
parent f86ad2ea4c
commit 21e8bbc8a2
12 changed files with 62 additions and 63 deletions

View File

@ -66,7 +66,7 @@ func buildPullConfig(ctx context.Context, dockerCli command.Cli, opts pluginOpti
return client.PluginInstallOptions{}, err
}
repoInfo := registry.ParseRepositoryInfo(ref)
indexInfo := registry.NewIndexInfo(ref)
remote := ref.String()
_, isCanonical := ref.(reference.Canonical)
@ -84,7 +84,7 @@ func buildPullConfig(ctx context.Context, dockerCli command.Cli, opts pluginOpti
remote = reference.FamiliarString(trusted)
}
authConfig := command.ResolveAuthConfig(dockerCli.ConfigFile(), repoInfo.Index)
authConfig := command.ResolveAuthConfig(dockerCli.ConfigFile(), indexInfo)
encodedAuth, err := registrytypes.EncodeAuthConfig(authConfig)
if err != nil {
return client.PluginInstallOptions{}, err