[codex] clean up Kubernetes snapshot registry images - #1426
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1bdd4c3d3a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acf2fdf6e3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@Pangjiping Could you please review this PR when you have time? If the changes look correct and the required checks pass, would you be willing to merge it? I will address any requested changes promptly. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47782ffaac
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
The new e2e check is failing on all 8 Controller E2E PauseResume jobs (e.g. https://github.com/opensandbox-group/OpenSandbox/actions/runs/31482910826/job/93751835292): deterministic Timeline in the job log shows the snapshot CR was already gone ( Most likely root cause: a digest mismatch. Suggestions:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 179cae69ea
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return ctrl.Result{}, deleteErr | ||
| } | ||
| log.Info("Deleted unpause job", "job", unpauseJobName) | ||
| if err := r.deleteSnapshotImages(ctx, snapshot); err != nil { |
There was a problem hiding this comment.
Preserve snapshot images used by resumed pods
When this finalizer runs for the internal pause snapshot after a successful resume, continueResume has already patched the BatchSandbox template to status.containers[].imageUri, and persistRuntimeView then deletes that internal snapshot as soon as the resumed pod is Ready. Deleting the registry manifest here therefore leaves the resumed sandbox dependent on an image that no longer exists: if the pod is later evicted/rescheduled or the node image is GC'd, Kubernetes will pull the now-deleted snapshot image and the sandbox will fail. Keep internal resume images until the template is no longer using them, or only run registry cleanup for user-requested snapshot deletions.
AGENTS.md reference: kubernetes/AGENTS.md:L170-L176
Useful? React with 👍 / 👎.
|
@Pangjiping The CI failure was caused by the recorded local content-store digest differing from the registry manifest digest after nerdctl media-type conversion. I pushed the fix in commits |
|
@Pangjiping The latest CI run still failed in every PauseResume matrix at |
|
@Pangjiping The fork CI confirmed the manifest cleanup assertion now passes. All 8 PauseResume jobs failed later by timing out in |
|
@Pangjiping The snapshot-related CI is fully green on head The separate fork |
|
@Pangjiping The current head
The upstream PR currently only shows |
Summary
SandboxSnapshotis deletedRoot cause
The Kubernetes snapshot finalizer only removed commit and unpause Jobs before removing itself. It never used
status.containers[].imageUriorimageDigestto delete the pushed manifests, leaving orphaned images in the registry.Implementation
The controller now deletes each unique snapshot manifest before removing the finalizer. It prefers the recorded digest, resolves legacy tag-only snapshots to a digest, treats missing manifests as an idempotent success, and supports the existing Docker config registry secret and insecure-registry setting.
Validation
cd kubernetes && make testcd docs && pnpm docs:buildgit diff --checkFixes #1179