fix(kubernetes): make snapshot pushes platform-safe - #1419
Open
ruirui6946 wants to merge 2 commits into
Open
Conversation
ruirui6946
requested review from
Generalwin,
Pangjiping,
Spground,
fengcone,
hittyt,
kevinlynx and
ninan-nn
as code owners
July 29, 2026 16:24
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the Kubernetes image-committer snapshot push path to be platform-safe, addressing snapshot/pause failures when committing/pushing multi-platform–derived sidecar images (issue #1382) by ensuring nerdctl push targets the committer’s explicit runtime platform and by enforcing a nerdctl version with the required content-recovery behavior.
Changes:
- Upgrade the image-committer runtime image to Alpine 3.21 and assert nerdctl v2+ in the runtime container.
- Update image pushing to use
nerdctl push --platform <runtime>(plus--insecure-registrywhen applicable) via a dedicated helper. - Add a focused unit test validating the constructed
nerdctl pusharguments include the runtime platform.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
kubernetes/Dockerfile.image-committer |
Moves runtime base to Alpine 3.21 and enforces nerdctl v2+ at build time. |
kubernetes/cmd/image-committer/main.go |
Adds explicit runtime-platform selection to nerdctl push via helper functions. |
kubernetes/cmd/image-committer/main_test.go |
Adds unit coverage to lock in the expected nerdctl push argument shape and platform selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nerdctl pusharguments.Closes #1382.
Testing
go test ./cmd/image-committer -count=1go test ./internal/controller -run 'Test(SandboxSnapshot|BuildCommitJob)' -count=1go vet ./cmd/image-committerDockerfile.image-committer; verified the runtime contains nerdctl 2.0.5.content digest ... not found.1 Passed,0 Failed).Breaking Changes
Checklist