Skip to content

Commit fb3f2da

Browse files
committed
cli/command/plugin: remove special error handling on install, upgrade
Similar to 323fbc4 - this code was added in [moby@c127d96], but used string-matching to detect cases where a user tried to install an image as plugin. However, this handling no longer matched any error-strings, so no longer worked: docker plugin install busybox Error response from daemon: did not find plugin config for specified reference docker.io/library/busybox:latest [moby@c127d96]: moby/moby@c127d96 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 183337d commit fb3f2da

File tree

3 files changed

+0
-16
lines changed

3 files changed

+0
-16
lines changed

cli/command/plugin/install.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package plugin
33
import (
44
"context"
55
"fmt"
6-
"strings"
76

87
"github.com/distribution/reference"
98
"github.com/docker/cli/cli"
@@ -94,9 +93,6 @@ func runInstall(ctx context.Context, dockerCLI command.Cli, opts pluginOptions)
9493
}
9594
responseBody, err := dockerCLI.Client().PluginInstall(ctx, localName, options)
9695
if err != nil {
97-
if strings.Contains(err.Error(), "(image) when fetching") {
98-
return errors.New(err.Error() + " - Use \"docker image pull\"")
99-
}
10096
return err
10197
}
10298
defer func() {

cli/command/plugin/install_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ func TestInstallErrors(t *testing.T) {
4242
return nil, errors.New("error installing plugin")
4343
},
4444
},
45-
{
46-
description: "installation error due to missing image",
47-
args: []string{"foo"},
48-
expectedError: "docker image pull",
49-
installFunc: func(name string, options client.PluginInstallOptions) (io.ReadCloser, error) {
50-
return nil, errors.New("(image) when fetching")
51-
},
52-
},
5345
}
5446

5547
for _, tc := range testCases {

cli/command/plugin/upgrade.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package plugin
33
import (
44
"context"
55
"fmt"
6-
"strings"
76

87
"github.com/distribution/reference"
98
"github.com/docker/cli/cli"
@@ -83,9 +82,6 @@ func runUpgrade(ctx context.Context, dockerCLI command.Cli, opts pluginOptions)
8382

8483
responseBody, err := dockerCLI.Client().PluginUpgrade(ctx, opts.localName, options)
8584
if err != nil {
86-
if strings.Contains(err.Error(), "target is image") {
87-
return errors.New(err.Error() + " - Use `docker image pull`")
88-
}
8985
return err
9086
}
9187
defer func() {

0 commit comments

Comments
 (0)