Skip to content

Commit

Permalink
🐛 Do not overwrite provided labels if specified. (#4897)
Browse files Browse the repository at this point in the history
Signed-off-by: Preslav <preslav@mondoo.com>
  • Loading branch information
preslavgerchev authored Nov 20, 2024
1 parent e0e28b9 commit 769aae4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion providers/os/connection/container/image_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ func NewRegistryImage(id uint32, conf *inventory.Config, asset *inventory.Asset)
}

conn.Metadata.Labels = labels
asset.Labels = labels
if asset.Labels == nil {
asset.Labels = map[string]string{}
}

for k, v := range labels {
asset.Labels[k] = v
}

return conn, err
}
Expand Down

0 comments on commit 769aae4

Please sign in to comment.