Skip to content

Commit

Permalink
Fallback to id if idLike doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Moran authored and ForestEckhardt committed Apr 29, 2022
1 parent f95ee58 commit 5fa7790
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sbom/internal/formats/syft2/to_format_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,15 @@ func toDistroModel(d *linux.Release) model.Distro {
return model.Distro{}
}

idLike := d.ID
if len(d.IDLike) > 0 {
// TODO: (packit) Is picking the 1st from this list the right thing to do?
idLike = d.IDLike[0]
}

return model.Distro{
Name: d.ID,
Version: d.Version,
// TODO: (packit) Is picking the 1st from this list the right thing to do?
IDLike: d.IDLike[0],
IDLike: idLike,
}
}

0 comments on commit 5fa7790

Please sign in to comment.