Skip to content

Commit c558c30

Browse files
authored
Merge pull request #6374 from thaJeztah/plugin_errs
cli/command/image: remove special handling for plugin errors on pull
2 parents 7dfa471 + 323fbc4 commit c558c30

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

cli/command/image/pull.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ package image
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
6-
"strings"
77

88
"github.com/distribution/reference"
99
"github.com/docker/cli/cli"
1010
"github.com/docker/cli/cli/command"
1111
"github.com/docker/cli/cli/command/completion"
1212
"github.com/docker/cli/cli/trust"
13-
"github.com/pkg/errors"
1413
"github.com/spf13/cobra"
1514
)
1615

@@ -78,15 +77,13 @@ func runPull(ctx context.Context, dockerCLI command.Cli, opts pullOptions) error
7877
// Check if reference has a digest
7978
_, isCanonical := distributionRef.(reference.Canonical)
8079
if !opts.untrusted && !isCanonical {
81-
err = trustedPull(ctx, dockerCLI, imgRefAndAuth, opts)
80+
if err := trustedPull(ctx, dockerCLI, imgRefAndAuth, opts); err != nil {
81+
return err
82+
}
8283
} else {
83-
err = imagePullPrivileged(ctx, dockerCLI, imgRefAndAuth, opts)
84-
}
85-
if err != nil {
86-
if strings.Contains(err.Error(), "when fetching 'plugin'") {
87-
return errors.New(err.Error() + " - Use `docker plugin install`")
84+
if err := imagePullPrivileged(ctx, dockerCLI, imgRefAndAuth, opts); err != nil {
85+
return err
8886
}
89-
return err
9087
}
9188
_, _ = fmt.Fprintln(dockerCLI.Out(), imgRefAndAuth.Reference().String())
9289
return nil

0 commit comments

Comments
 (0)