Merge pull request #11599 from k8s-infra-cherrypick-robot/cherry-pick-11581-to-release/2.0

[release/2.0] *: CRIImageService should delete image synchronously
This commit is contained in:
Fu Wei 2025-03-25 09:47:53 -04:00 committed by GitHub
commit c146996f3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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