cli/command/trust: remove errdefs uses

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-05-16 20:07:17 +02:00
parent 1168edb259
commit 251725676e
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -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