Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image delete target #8989

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

dmcgowan
Copy link
Member

Adds atomicity to image delete when deleting from a list.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@dmcgowan
Copy link
Member Author

/test all

@dmcgowan dmcgowan marked this pull request as ready for review August 22, 2023 00:33
@dmcgowan
Copy link
Member Author

Updated and marked as ready for review

image_store.go Outdated Show resolved Hide resolved
metadata/images.go Outdated Show resolved Hide resolved
@dmcgowan
Copy link
Member Author

Updated

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

original: imageBase(),
input: images.Image{
Target: ocispec.Descriptor{
Size: 20,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder why do we use 20 here while all other places have 10?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably document it better, // Input target size determines target digest, base image uses 10. The digest is generated with the size testcase.original.Target.Digest = digest.FromString(fmt.Sprintf("%s-%d", testcase.name, testcase.original.Target.Size)) so to change the image on update, the size must change

Copy link
Member

@henry118 henry118 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -72,6 +73,13 @@ func SynchronousDelete() DeleteOpt {
}
}

func DeleteTarget(target *ocispec.Descriptor) DeleteOpt {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we maybe add some godoc here (a la

// SynchronousDelete is used to indicate that an image deletion and removal of
// the image resources should occur synchronously before returning a result.
func SynchronousDelete() DeleteOpt {
)

Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM <3! (just left a little nit for a comment)

Signed-off-by: Derek McGowan <derek@mcg.dev>
Adds atomicity to image delete when deleting from a list.

Signed-off-by: Derek McGowan <derek@mcg.dev>
@dmcgowan
Copy link
Member Author

Updated

@AkihiroSuda AkihiroSuda merged commit 66aab63 into containerd:main Oct 5, 2023
45 checks passed
@dmcgowan dmcgowan deleted the add-image-delete-target branch April 20, 2024 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

7 participants