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

Refactor image deletion in OCI #2551

Merged
merged 12 commits into from
Sep 9, 2024
Merged

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Sep 3, 2024

  • Count the references directly into a single map, instead of allocating partial maps and copying data between them
  • Restructure to minimize code duplication

Should not change behavior, overall. See individual commits and commit messages for details and an easier-to-review version.

@rhatdan
Copy link
Member

rhatdan commented Sep 3, 2024

LGTM

@mtrmac mtrmac force-pushed the oci-delete-refactor branch 2 times, most recently from 4db8981 to a3c2a85 Compare September 5, 2024 18:05
@rhatdan
Copy link
Member

rhatdan commented Sep 5, 2024

@Luap99 @giuseppe PTAL

@rhatdan
Copy link
Member

rhatdan commented Sep 5, 2024

@kolyshkin PTAL

... and use slices.Contains instead of a manual loop.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
... so that we don't always create a new map.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
…ation

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
... instead of maintaining two copies.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
…only caller

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
... and document it a bit better

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

@rhatdan rhatdan merged commit 1a02a3d into containers:main Sep 9, 2024
10 checks passed
@mtrmac mtrmac deleted the oci-delete-refactor branch September 9, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants