Skip to content

Conversation

@realrajaryan
Copy link
Contributor

@realrajaryan realrajaryan commented Nov 20, 2025

Rename _prune() to cleanupOrphanedBlobs() to clarify what it actually does, and remove prune() method as we'll do all that logic in container directly.

@realrajaryan
Copy link
Contributor Author

making cleanupOrphanedBlobs public because we'll need it in container as well

@jglogan
Copy link
Contributor

jglogan commented Nov 20, 2025

Could this be handled without any changes to Containerization? That is to say:

  • image prune cleans only orphaned blobs (those with no image references)
  • image prune --all the API server first finds all images having no container references , runs rm on all of those, then cleans orphaned blobs

Copy link
Contributor

@jglogan jglogan left a comment

Choose a reason for hiding this comment

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

See above comment. I guess we would need to make cleanOrphanedBlobs() public for image prune but could we do the image pruning completely in container-apiserver?

@realrajaryan
Copy link
Contributor Author

See above comment. I guess we would need to make cleanOrphanedBlobs() public for image prune but could we do the image pruning completely in container-apiserver?

Yeah like we discussed, we basically rename _prune to cleanupOrphanedBlobs() to clarify what it actually does, and I'll handle the rest of the pruning logic in container.

@realrajaryan realrajaryan requested a review from jglogan November 20, 2025 23:10
@realrajaryan realrajaryan merged commit 860139b into apple:main Nov 20, 2025
2 checks passed
richardkiene added a commit to Vas-Solutus/arca-containerization that referenced this pull request Dec 1, 2025
Sync with Apple's containerization repo (57 commits behind).

Notable upstream changes:
- LinuxContainer: "Harden" stop (apple#388)
- OCI runtime support (apple#416)
- Memory threshold monitoring (apple#427)
- FileHandle option for serial console (apple#410)
- Keep reference to vended execs (apple#408)
- Sync(2) on shutdown (apple#400)
- Fix ImageStore.prune() behavior (apple#420)
- Various stability improvements

Resolved conflicts:
- LinuxContainer.swift: Merged bootLog type change with our useNetworkNamespace
- Application.swift: Kept our service startup code (removed old log line per upstream)
- Server+GRPC.swift: Used upstream's async ManagedContainer, kept our DNS comment
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.

[Bug]: ImageStore.prune() doesn't remove unreferenced images

3 participants