Repository navigation
Conversation
pohanhuang
requested changes
Sep 23, 2026
pohanhuang
left a comment
Contributor
There was a problem hiding this comment.
Thanks for contribution, this is a good fouding!
Comment on lines
+64
to
+70
| func dockerImageSaveID(id string) string { | ||
| if len(id) == 64 { | ||
| return "sha256:" + id | ||
| } | ||
| return id | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Suggested change
| func dockerImageSaveID(id string) string { | |
| if len(id) == 64 { | |
| return "sha256:" + id | |
| } | |
| return id | |
| } | |
| const sha256Prefix = "sha256:" | |
| func dockerImageSaveID(id string) string { | |
| if d, err := goDigest.Parse(id); err == nil { | |
| return d.String() | |
| } | |
| if d, err := goDigest.Parse(sha256Prefix + id); err == nil { | |
| return d.String() | |
| } | |
| return id | |
| } |
Contributor
|
@clbiggs are you still working on this issue? |
Contributor
|
Closing this for the issue has been resolve in #597 |
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.
Description
Fix local image scanning when Docker uses the containerd image store.
With the containerd image store, Docker may return an image ID as a bare 64-character SHA-256 value. Newer Docker versions reject that value when it is passed to the image-save API without the
sha256:prefix:Fix neuvector/neuvector#2508
Test
go test ./cvetoolsResult:
ok github.com/neuvector/scanner/cvetoolsAdditional Information
This keeps the existing behavior for the overlay2 image store while allowing locally cached images to be scanned when Docker uses the containerd image store.