{{ message }}
pkg build: fix nil pointer dereference when releasing image only in registry#4212
Merged
justincormack merged 1 commit intoMar 27, 2026
Merged
Conversation
…egistry When an image exists in the registry but not in local cache and a release tag is requested, FindDescriptor returns nil causing a panic at build.go:588. This was a regression introduced in 4129cc7 which removed the early return for missing local cache images. Fix by pulling the image into local cache when the descriptor is nil and a release is needed. Also guard the targetDocker block against nil descriptors, and fix the FindDescriptor mock to return nil,nil (matching the real implementation) instead of an error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Paul Gaiduk <paulg@zededa.com>
f92356f to
420d550
Compare
justincormack
approved these changes
Mar 27, 2026
europaul
added a commit
to europaul/eve
that referenced
this pull request
Mar 27, 2026
Update to include the fix from linuxkit/linuxkit#4212 Signed-off-by: Paul Gaiduk <paulg@zededa.com>
rene
pushed a commit
to lf-edge/eve
that referenced
this pull request
Mar 27, 2026
Update to include the fix from linuxkit/linuxkit#4212 Signed-off-by: Paul Gaiduk <paulg@zededa.com>
europaul
added a commit
to europaul/eve
that referenced
this pull request
Mar 31, 2026
Update to include the fix from linuxkit/linuxkit#4212 Signed-off-by: Paul Gaiduk <paulg@zededa.com> (cherry picked from commit 691bb26)
europaul
added a commit
to europaul/eve
that referenced
this pull request
Mar 31, 2026
Update to include the fix from linuxkit/linuxkit#4212 Signed-off-by: Paul Gaiduk <paulg@zededa.com> (cherry picked from commit 691bb26)
rene
pushed a commit
to lf-edge/eve
that referenced
this pull request
Apr 1, 2026
Update to include the fix from linuxkit/linuxkit#4212 Signed-off-by: Paul Gaiduk <paulg@zededa.com> (cherry picked from commit 691bb26)
rene
pushed a commit
to lf-edge/eve
that referenced
this pull request
Apr 2, 2026
Update to include the fix from linuxkit/linuxkit#4212 Signed-off-by: Paul Gaiduk <paulg@zededa.com> (cherry picked from commit 691bb26)
europaul
added a commit
to europaul/eve
that referenced
this pull request
Apr 7, 2026
Update to include the fix from linuxkit/linuxkit#4212 Signed-off-by: Paul Gaiduk <paulg@zededa.com> (cherry picked from commit 691bb26)
rene
pushed a commit
to lf-edge/eve
that referenced
this pull request
Apr 11, 2026
Update to include the fix from linuxkit/linuxkit#4212 Signed-off-by: Paul Gaiduk <paulg@zededa.com> (cherry picked from commit 691bb26)
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.

- What I did
Fixed a nil pointer dereference (panic) in
pkglib.Pkg.Buildatbuild.go:588that occurs when pushing with--releaseand the image already exists in the registry but not in the local cache.This is a regression introduced in 4129cc7 (#4201), which removed the early return for missing local cache images to allow release tags to be pushed even when the digest tag already exists.
- How I did it
descis nil (image not in local cache) and a release is requested, pull the image into local cache before creating the release tag.targetDockerblock against nil descriptors — if nothing is in local cache, there is nothing to load into Docker.FindDescriptormock in tests to returnnil, nilwhen not found, matching the real implementation's documented behavior.TestPushReleaseImageInRegistryregression test that reproduces the exact panic.- How to verify it
Run the new test without the fix to see the panic:
Run all tests with the fix:
- Description for the changelog
Fix nil pointer dereference when pushing with
--releaseand the image already exists in the registry but not in the local cache.