Skip to content

Refactor image deletion in OCI#2551

Merged
rhatdan merged 12 commits intocontainers:mainfrom
mtrmac:oci-delete-refactor
Sep 9, 2024
Merged

Refactor image deletion in OCI#2551
rhatdan merged 12 commits intocontainers:mainfrom
mtrmac:oci-delete-refactor

Conversation

@mtrmac
Copy link
Copy Markdown
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.

@mtrmac mtrmac force-pushed the oci-delete-refactor branch from 8b2204a to 0c12b6c Compare September 3, 2024 19:19
@rhatdan
Copy link
Copy Markdown
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
Copy Markdown
Member

rhatdan commented Sep 5, 2024

@Luap99 @giuseppe PTAL

@rhatdan
Copy link
Copy Markdown
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č <mitr@redhat.com>
... so that we don't always create a new map.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
…ation

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... instead of maintaining two copies.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
…only caller

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... and document it a bit better

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@mtrmac mtrmac force-pushed the oci-delete-refactor branch from a3c2a85 to f957a9e Compare September 5, 2024 19:40
Copy link
Copy Markdown
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
@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