Update errdefs to 0.3.0

Uses the new github.com/containerd/errdefs/pkg module which is intended
to hold less stable utility functions separately from the stable
github.com/containerd/errdefs error types.

Includes temporary update to hcsshim until a release is cut there

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2024-10-18 15:57:27 -07:00
parent b291eb802b
commit 2f24aa00a5
61 changed files with 2054 additions and 529 deletions

View File

@@ -21,9 +21,11 @@ import (
"fmt"
apitasks "github.com/containerd/containerd/api/services/tasks/v1"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/errdefs"
"github.com/containerd/errdefs/pkg/errgrpc"
"github.com/containerd/log"
containerd "github.com/containerd/containerd/v2/client"
)
func (c *Controller) Shutdown(ctx context.Context, sandboxID string) error {
@@ -114,7 +116,7 @@ func (c *Controller) cleanupSandboxTask(ctx context.Context, sbCntr containerd.C
if errdefs.IsNotFound(err) {
_, err = c.client.TaskService().Delete(ctx, &apitasks.DeleteTaskRequest{ContainerID: sbCntr.ID()})
if err != nil {
err = errdefs.FromGRPC(err)
err = errgrpc.ToNative(err)
if !errdefs.IsNotFound(err) {
return fmt.Errorf("failed to cleanup sandbox %s in task-service: %w", sbCntr.ID(), err)
}