Skip to content

Commit

Permalink
🐛 Prevent k8s scan panic
Browse files Browse the repository at this point in the history
When scanning k8s with container image discovery, it paniced.
That happened because asset data was missing.

Fixes #1749

Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker committed Sep 18, 2023
1 parent 03484e0 commit b6c5985
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion explorer/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ func (s *LocalScanner) distributeJob(job *Job, ctx context.Context, upstream *up

justAssets := []*inventory.Asset{}
for _, asset := range assets {
asset.asset.KindString = asset.asset.GetPlatform().Kind
if asset.asset.GetPlatform() != nil {
asset.asset.KindString = asset.asset.GetPlatform().Kind
} else {
asset.asset = asset.runtime.Provider.Connection.Asset
asset.asset.KindString = asset.runtime.Provider.Connection.Asset.Platform.Kind
}
justAssets = append(justAssets, asset.asset)
}

Expand Down

0 comments on commit b6c5985

Please sign in to comment.