Skip to content

Commit

Permalink
🐛 Fix platformID for container images
Browse files Browse the repository at this point in the history
When scanning a single image which isn't present in the local docker daemon, the platformID was missing.

Fixes #1952

Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker committed Sep 27, 2023
1 parent e640089 commit 033d3dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion providers/os/connection/docker_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ func NewDockerContainerImageConnection(id uint32, conf *inventory.Config, asset

// The requested image isn't locally available, but we can pull it from a remote registry.
if len(resolvedAssets) > 0 && resolvedAssets[0].Connections[0].Type == "container-registry" {
return NewContainerRegistryImage(id, conf, resolvedAssets[0])
asset.Name = resolvedAssets[0].Name
asset.PlatformIds = resolvedAssets[0].PlatformIds
asset.Labels = resolvedAssets[0].Labels
return NewContainerRegistryImage(id, conf, asset)
}

// could be an image id/name, container id/name or a short reference to an image in docker engine
Expand Down

0 comments on commit 033d3dc

Please sign in to comment.