cli/command/trust: remove errdefs uses
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
1168edb259
commit
251725676e
@ -9,7 +9,6 @@ import (
|
|||||||
"github.com/docker/cli/cli/command/image"
|
"github.com/docker/cli/cli/command/image"
|
||||||
"github.com/docker/cli/cli/trust"
|
"github.com/docker/cli/cli/trust"
|
||||||
"github.com/docker/cli/internal/prompt"
|
"github.com/docker/cli/internal/prompt"
|
||||||
"github.com/docker/docker/errdefs"
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/theupdateframework/notary/client"
|
"github.com/theupdateframework/notary/client"
|
||||||
@ -50,7 +49,7 @@ func revokeTrust(ctx context.Context, dockerCLI command.Cli, remote string, opti
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !deleteRemote {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type cancelledErr struct{ error }
|
||||||
|
|
||||||
|
func (cancelledErr) Cancelled() {}
|
||||||
|
|
||||||
func revokeSignature(notaryRepo client.Repository, tag string) error {
|
func revokeSignature(notaryRepo client.Repository, tag string) error {
|
||||||
if tag != "" {
|
if tag != "" {
|
||||||
// Revoke signature for the specified tag
|
// Revoke signature for the specified tag
|
||||||
|
Loading…
x
Reference in New Issue
Block a user