Skip to content

Commit 0911431

Browse files
fuweidk8s-infra-cherrypick-robot
authored andcommitted
*: CRIImageService should delete image synchronously
Use memory service instead of metadata store. Signed-off-by: Wei Fu <[email protected]>
1 parent 148fbbb commit 0911431

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

plugins/cri/images/plugin.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,12 @@ func init() {
7373

7474
options := &images.CRIImageServiceOptions{
7575
Content: mdb.ContentStore(),
76-
Images: metadata.NewImageStore(mdb),
7776
RuntimePlatforms: map[string]images.ImagePlatform{},
7877
Snapshotters: map[string]snapshots.Snapshotter{},
7978
ImageFSPaths: map[string]string{},
8079
}
8180

82-
options.Client, err = containerd.New(
81+
ctrdCli, err := containerd.New(
8382
"",
8483
containerd.WithDefaultNamespace(constants.K8sContainerdNamespace),
8584
containerd.WithDefaultPlatform(platforms.Default()),
@@ -88,6 +87,8 @@ func init() {
8887
if err != nil {
8988
return nil, fmt.Errorf("unable to init client for cri image service: %w", err)
9089
}
90+
options.Images = ctrdCli.ImageService()
91+
options.Client = ctrdCli
9192

9293
allSnapshotters := mdb.Snapshotters()
9394
defaultSnapshotter := config.Snapshotter

0 commit comments

Comments
 (0)