Skip to content

Commit

Permalink
🐛 Fix missing platform for container image discovery (#981)
Browse files Browse the repository at this point in the history
This fixes the error:
'unable to detect platform for asset ...'

Signed-off-by: Christian Zunker <christian@mondoo.com>
  • Loading branch information
czunker authored Dec 6, 2023
1 parent fe9b625 commit ae0e1b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions policy/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ func createAssetCandidateList(ctx context.Context, job *Job, upstream *upstream.
log.Error().Err(err).Msg("unable to connect to asset")
continue
}
resolvedAsset = runtime.Provider.Connection.Asset // to ensure we get all the information the connect call gave us

// for all discovered assets, we apply mondoo-specific labels and annotations that come from the root asset
for _, a := range runtime.Provider.Connection.GetInventory().GetSpec().GetAssets() {
Expand Down Expand Up @@ -345,6 +346,7 @@ func (s *LocalScanner) distributeJob(job *Job, ctx context.Context, upstream *up
log.Error().Err(err).Msg("unable to connect to asset")
continue
}
candidate.asset = runtime.Provider.Connection.Asset // to ensure we get all the information the connect call gave us

if candidate.asset.GetPlatform() == nil {
log.Error().Msgf("unable to detect platform for asset " + candidate.asset.Name)
Expand Down

0 comments on commit ae0e1b6

Please sign in to comment.