switch to github.com/containerd/errdefs for error-matching

replace uses of docker/errdefs.IsXXX utilities with their containerd/errdefs
equivalent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-05-16 15:18:18 +02:00
parent c108da5d19
commit 557cabb71e
24 changed files with 843 additions and 42 deletions

View File

@ -5,11 +5,11 @@ import (
"errors"
"fmt"
cerrdefs "github.com/containerd/errdefs"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/completion"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/errdefs"
"github.com/spf13/cobra"
)
@ -64,7 +64,7 @@ func runRemove(ctx context.Context, dockerCLI command.Cli, opts removeOptions, i
for _, img := range images {
dels, err := apiClient.ImageRemove(ctx, img, options)
if err != nil {
if !errdefs.IsNotFound(err) {
if !cerrdefs.IsNotFound(err) {
fatalErr = true
}
errs = append(errs, err)