From 091143135ba903808c76fbdd10316975dcf4b0f1 Mon Sep 17 00:00:00 2001 From: Wei Fu Date: Fri, 21 Mar 2025 21:11:35 -0400 Subject: [PATCH] *: CRIImageService should delete image synchronously Use memory service instead of metadata store. Signed-off-by: Wei Fu --- plugins/cri/images/plugin.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/cri/images/plugin.go b/plugins/cri/images/plugin.go index ab6296d22..844fe7439 100644 --- a/plugins/cri/images/plugin.go +++ b/plugins/cri/images/plugin.go @@ -73,13 +73,12 @@ func init() { options := &images.CRIImageServiceOptions{ Content: mdb.ContentStore(), - Images: metadata.NewImageStore(mdb), RuntimePlatforms: map[string]images.ImagePlatform{}, Snapshotters: map[string]snapshots.Snapshotter{}, ImageFSPaths: map[string]string{}, } - options.Client, err = containerd.New( + ctrdCli, err := containerd.New( "", containerd.WithDefaultNamespace(constants.K8sContainerdNamespace), containerd.WithDefaultPlatform(platforms.Default()), @@ -88,6 +87,8 @@ func init() { if err != nil { return nil, fmt.Errorf("unable to init client for cri image service: %w", err) } + options.Images = ctrdCli.ImageService() + options.Client = ctrdCli allSnapshotters := mdb.Snapshotters() defaultSnapshotter := config.Snapshotter