File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,7 +256,6 @@ func (e Extractor) parseDependenciesFile(reader io.Reader, path string) ([]*extr
256256 packages = append (packages , pkg )
257257 continue
258258 }
259-
260259 }
261260
262261 if err := scanner .Err (); err != nil {
Original file line number Diff line number Diff line change @@ -39,6 +39,15 @@ func MakeEcosystem(metadata any) osvecosystem.Parsed {
3939 osVersionID := ""
4040 switch m := metadata .(type ) {
4141 case * apkmeta.Metadata :
42+ // Check for specific distros that use APK but map to different ecosystems.
43+ // These checks must come before the version == "" guard because rolling
44+ // distros (Wolfi, Chainguard) may not set VERSION_ID in os-release.
45+ if m .OSID == "wolfi" {
46+ return osvecosystem .FromEcosystem (osvconstants .EcosystemWolfi )
47+ }
48+ if m .OSID == "chainguard" {
49+ return osvecosystem .FromEcosystem (osvconstants .EcosystemChainguard )
50+ }
4251 version := m .ToDistro ()
4352 if version == "" {
4453 return osvecosystem .FromEcosystem (osvconstants .EcosystemAlpine )
Original file line number Diff line number Diff line change @@ -89,6 +89,20 @@ func TestMakeEcosystemAPK(t *testing.T) {
8989 },
9090 want : "BellSoft Hardened Containers:stream" ,
9191 },
92+ {
93+ desc : "Wolfi" ,
94+ metadata : & apkmeta.Metadata {
95+ OSID : "wolfi" ,
96+ },
97+ want : "Wolfi" ,
98+ },
99+ {
100+ desc : "Chainguard" ,
101+ metadata : & apkmeta.Metadata {
102+ OSID : "chainguard" ,
103+ },
104+ want : "Chainguard" ,
105+ },
92106 }
93107 for _ , tt := range tests {
94108 t .Run (tt .desc , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments