Skip to content

Commit 04c7d6c

Browse files
authored
Merge pull request containerd#9960 from adrianreber/2024-03-12-criu-not-found
Return correct error if CRIU binary is missing
2 parents 6c72ad9 + 218e2cf commit 04c7d6c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

internal/cri/server/container_checkpoint_linux.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ import (
4141
"github.com/containerd/containerd/v2/plugins"
4242
"github.com/containerd/log"
4343
v1 "github.com/opencontainers/image-spec/specs-go/v1"
44-
"google.golang.org/grpc/codes"
45-
"google.golang.org/grpc/status"
4644

4745
"github.com/containerd/containerd/v2/client"
4846
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
@@ -73,8 +71,17 @@ func (c *criService) CheckpointContainer(ctx context.Context, r *runtime.Checkpo
7371
// This is the wrong error message and needs to be adapted once
7472
// Kubernetes (the e2e_node/checkpoint) test has been changed to
7573
// handle too old or missing CRIU error messages.
76-
log.G(ctx).WithError(err).Errorf("Failed to checkpoint container %q", r.GetContainerId())
77-
return nil, status.Errorf(codes.Unimplemented, "method CheckpointContainer not implemented")
74+
errorMessage := fmt.Sprintf(
75+
"CRIU binary not found or too old (<%d). Failed to checkpoint container %q",
76+
podCriuVersion,
77+
r.GetContainerId(),
78+
)
79+
log.G(ctx).WithError(err).Errorf(errorMessage)
80+
return nil, fmt.Errorf(
81+
"%s: %w",
82+
errorMessage,
83+
err,
84+
)
7885
}
7986

8087
container, err := c.containerStore.Get(r.GetContainerId())

0 commit comments

Comments
 (0)