diff --git a/cli/command/trust/revoke.go b/cli/command/trust/revoke.go index ec32c797f2..303c7b8c2d 100644 --- a/cli/command/trust/revoke.go +++ b/cli/command/trust/revoke.go @@ -9,7 +9,6 @@ import ( "github.com/docker/cli/cli/command/image" "github.com/docker/cli/cli/trust" "github.com/docker/cli/internal/prompt" - "github.com/docker/docker/errdefs" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/theupdateframework/notary/client" @@ -50,7 +49,7 @@ func revokeTrust(ctx context.Context, dockerCLI command.Cli, remote string, opti return err } if !deleteRemote { - return errdefs.Cancelled(errors.New("trust revoke has been cancelled")) + return cancelledErr{errors.New("trust revoke has been cancelled")} } } @@ -70,6 +69,10 @@ func revokeTrust(ctx context.Context, dockerCLI command.Cli, remote string, opti return nil } +type cancelledErr struct{ error } + +func (cancelledErr) Cancelled() {} + func revokeSignature(notaryRepo client.Repository, tag string) error { if tag != "" { // Revoke signature for the specified tag