Skip to content

fix(kubernetes): preserve snapshot source content - #1508

Draft
prazgaitis wants to merge 1 commit into
opensandbox-group:mainfrom
Quovy:agent/fix-image-committer-snapshot
Draft

fix(kubernetes): preserve snapshot source content#1508
prazgaitis wants to merge 1 commit into
opensandbox-group:mainfrom
Quovy:agent/fix-image-committer-snapshot

Conversation

@prazgaitis

Copy link
Copy Markdown

Summary

  • Restore compressed source-image content before committing a sandbox snapshot. containerd can retain the unpacked rootfs while garbage-collecting the source blobs, which leaves a locally committed manifest that cannot be pushed.
  • Preserve the committed manifest by using nerdctl pull --all-platforms and nerdctl push --all-platforms.
  • Install the latest checksum-verified nerdctl release and refresh/pin the Alpine and Go build images.
  • Parse the source image from nerdctl inspect without being confused by interleaved network-namespace warnings.

Testing

  • Not run (explain why)
  • Unit tests (go test ./cmd/image-committer/...)
  • Integration tests (native linux/arm64 image build)
  • e2e / manual verification

The e2e test ran on k3d against the exact image-committer flow:

  1. Started a non-root sandbox and wrote a marker into its writable filesystem.
  2. Deliberately removed a compressed source layer from containerd while leaving the running sandbox and unpacked snapshot intact.
  3. Paused the sandbox; the committer restored the missing source blob, committed the container, and pushed the snapshot.
  4. Resumed from the pushed snapshot and verified the marker, runAsNonRoot, UID 1000, dropped capabilities, and RuntimeDefault seccomp profile were preserved.

Trivy 0.66 reported 0 Critical findings. The Alpine OS and OpenSandbox binary reported 0 High findings. The bundled latest nerdctl 2.3.5 binary reports two High findings in upstream Go dependencies (golang.org/x/text and google.golang.org/grpc); eliminating those before nerdctl publishes a refreshed release would require maintaining a custom nerdctl source build.

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (not needed; behavior is internal to snapshot creation)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

@github-actions github-actions Bot added component/k8s For kubernetes runtime size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/k8s For kubernetes runtime size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant