1
0
mirror of https://github.com/docker/cli.git synced 2026-01-06 05:41:44 +03:00

Merge pull request #6439 from thaJeztah/plugin_rm_special_handling

cli/command/plugin: remove special error handling on install, upgrade
This commit is contained in:
Sebastiaan van Stijn
2025-09-09 11:59:51 +02:00
committed by GitHub
3 changed files with 0 additions and 16 deletions

View File

@@ -3,7 +3,6 @@ package plugin
import (
"context"
"fmt"
"strings"
"github.com/distribution/reference"
"github.com/docker/cli/cli"
@@ -94,9 +93,6 @@ func runInstall(ctx context.Context, dockerCLI command.Cli, opts pluginOptions)
}
responseBody, err := dockerCLI.Client().PluginInstall(ctx, localName, options)
if err != nil {
if strings.Contains(err.Error(), "(image) when fetching") {
return errors.New(err.Error() + " - Use \"docker image pull\"")
}
return err
}
defer func() {

View File

@@ -42,14 +42,6 @@ func TestInstallErrors(t *testing.T) {
return nil, errors.New("error installing plugin")
},
},
{
description: "installation error due to missing image",
args: []string{"foo"},
expectedError: "docker image pull",
installFunc: func(name string, options client.PluginInstallOptions) (io.ReadCloser, error) {
return nil, errors.New("(image) when fetching")
},
},
}
for _, tc := range testCases {

View File

@@ -3,7 +3,6 @@ package plugin
import (
"context"
"fmt"
"strings"
"github.com/distribution/reference"
"github.com/docker/cli/cli"
@@ -83,9 +82,6 @@ func runUpgrade(ctx context.Context, dockerCLI command.Cli, opts pluginOptions)
responseBody, err := dockerCLI.Client().PluginUpgrade(ctx, opts.localName, options)
if err != nil {
if strings.Contains(err.Error(), "target is image") {
return errors.New(err.Error() + " - Use `docker image pull`")
}
return err
}
defer func() {