summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--cmd/c2vm/main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/c2vm/main.go b/cmd/c2vm/main.go
index 4d0968b..5e9fbb0 100644
--- a/cmd/c2vm/main.go
+++ b/cmd/c2vm/main.go
@@ -42,6 +42,12 @@ func main() {
 	defer client.Close()
 
 	ctx := namespaces.WithNamespace(context.Background(), defaultNamespace)
+	ctx, done, err := client.WithLease(ctx)
+	if err != nil {
+		log.Fatalf("failed to get a lease: %v", err)
+	}
+	defer done(ctx)
+
 	image, err := client.Pull(ctx, *containerName, containerd.WithPlatformMatcher(platform))
 	if err != nil {
 		log.Fatalf("failed to pull the container %s: %v\n", *containerName, err)