mirror of
https://github.com/docker/cli.git
synced 2026-09-26 01:10:35 -04:00
remove redundant error-handling for registry.ParseRepositoryInfo
Since [moby@c2c3d59], [registry.ParseRepositoryInfo] now always returns a nil error, so we can remove the error handling. [registry.ParseRepositoryInfo]: https://github.com/moby/moby/blob/5f0d6731eb015c8e46b2ae9bb1803d005f2513be/registry/config.go#L414-L443 [moby@c2c3d59]: https://github.com/moby/moby/commit/c2c3d593cf9e24750e99aa0771fac39307d797b3 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -74,8 +74,6 @@ Image index won't be pushed, meaning that other manifests, including attestation
|
||||
}
|
||||
|
||||
// RunPush performs a push against the engine based on the specified options
|
||||
//
|
||||
//nolint:gocyclo
|
||||
func RunPush(ctx context.Context, dockerCli command.Cli, opts pushOptions) error {
|
||||
var platform *ocispec.Platform
|
||||
out := tui.NewOutput(dockerCli.Out())
|
||||
@@ -107,10 +105,7 @@ To push the complete multi-platform image, remove the --platform flag.
|
||||
}
|
||||
|
||||
// Resolve the Repository name from fqn to RepositoryInfo
|
||||
repoInfo, err := registry.ParseRepositoryInfo(ref)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
repoInfo, _ := registry.ParseRepositoryInfo(ref)
|
||||
|
||||
// Resolve the Auth config relevant for this server
|
||||
authConfig := command.ResolveAuthConfig(dockerCli.ConfigFile(), repoInfo.Index)
|
||||
|
||||
@@ -64,10 +64,7 @@ func buildPullConfig(ctx context.Context, dockerCli command.Cli, opts pluginOpti
|
||||
return types.PluginInstallOptions{}, err
|
||||
}
|
||||
|
||||
repoInfo, err := registry.ParseRepositoryInfo(ref)
|
||||
if err != nil {
|
||||
return types.PluginInstallOptions{}, err
|
||||
}
|
||||
repoInfo, _ := registry.ParseRepositoryInfo(ref)
|
||||
|
||||
remote := ref.String()
|
||||
|
||||
|
||||
@@ -49,10 +49,7 @@ func runPush(ctx context.Context, dockerCli command.Cli, opts pushOptions) error
|
||||
|
||||
named = reference.TagNameOnly(named)
|
||||
|
||||
repoInfo, err := registry.ParseRepositoryInfo(named)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
repoInfo, _ := registry.ParseRepositoryInfo(named)
|
||||
authConfig := command.ResolveAuthConfig(dockerCli.ConfigFile(), repoInfo.Index)
|
||||
encodedAuth, err := registrytypes.EncodeAuthConfig(authConfig)
|
||||
if err != nil {
|
||||
|
||||
@@ -51,11 +51,7 @@ func resolveServiceImageDigestContentTrust(dockerCli command.Cli, service *swarm
|
||||
}
|
||||
|
||||
func trustedResolveDigest(cli command.Cli, ref reference.NamedTagged) (reference.Canonical, error) {
|
||||
repoInfo, err := registry.ParseRepositoryInfo(ref)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
repoInfo, _ := registry.ParseRepositoryInfo(ref)
|
||||
authConfig := command.ResolveAuthConfig(cli.ConfigFile(), repoInfo.Index)
|
||||
|
||||
notaryRepo, err := trust.GetNotaryRepository(cli.In(), cli.Out(), command.UserAgent(), repoInfo, &authConfig, "pull")
|
||||
|
||||
Reference in New Issue
Block a user