From 9c6b71c95c8486226eb480bc1b316a0fca2255c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Fri, 24 Jul 2026 20:14:17 +0200 Subject: [PATCH] core/runtime/v2: Drop checkpointctl module dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shim imported github.com/checkpoint-restore/checkpointctl/lib for a single string constant. Consumers that embed only the runtime v2 plugin (and never touch internal/cri) therefore had to vendor the checkpointctl package. Declare the file name as a local constant instead. checkpointctl still remains a direct requirement here because internal/cri/server uses its types, JSON readers, and annotations, but it is no longer reachable from the runtime v2 import graph. Signed-off-by: Paweł Gronowski --- core/runtime/v2/shim.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/runtime/v2/shim.go b/core/runtime/v2/shim.go index ba823b65b256e..3909de66c0f29 100644 --- a/core/runtime/v2/shim.go +++ b/core/runtime/v2/shim.go @@ -34,7 +34,6 @@ import ( "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials/insecure" - crmetadata "github.com/checkpoint-restore/checkpointctl/lib" eventstypes "github.com/containerd/containerd/api/events" bootapi "github.com/containerd/containerd/api/runtime/bootstrap/v1" task "github.com/containerd/containerd/api/runtime/task/v3" @@ -64,6 +63,11 @@ const ( loadTimeout = "io.containerd.timeout.shim.load" cleanupTimeout = "io.containerd.timeout.shim.cleanup" shutdownTimeout = "io.containerd.timeout.shim.shutdown" + + // rootFsDiffTar is the name of the rootfs diff archive written next to a + // checkpoint. It is part of the checkpoint layout produced by CRIU tooling, + // so it must stay in sync with github.com/checkpoint-restore/checkpointctl/lib.RootFsDiffTar. + rootFsDiffTar = "rootfs-diff.tar" ) func init() { @@ -642,7 +646,7 @@ func (s *shimTask) Create(ctx context.Context, opts runtime.CreateOpts) (runtime if opts.RestoreFromPath { // Unpack rootfs-diff.tar if it exists. // This needs to happen between the 'Create()' from above and before the 'Start()' from below. - rootfsDiff := filepath.Join(opts.Checkpoint, "..", crmetadata.RootFsDiffTar) + rootfsDiff := filepath.Join(opts.Checkpoint, "..", rootFsDiffTar) _, err = os.Stat(rootfsDiff) if err == nil {