Skip to content

Commit

Permalink
added some comments and todo
Browse files Browse the repository at this point in the history
added some comments and todo
  • Loading branch information
cmaritan committed Jan 25, 2023
1 parent 91b497a commit a418625
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/lockfile/pkg_mgr_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import "io"

type OSPkgMgrDetailsParser = func(file io.ReadCloser, pathToLockfile string) ([]PackageDetails, error)

// PkgMgrParse maps package manager to its parser function
var PkgMgrParse = map[string]OSPkgMgrDetailsParser{
"apk": ParseApkInstalledFromReader,
"dpkg": ParseDpkgStatusFromReader,
}

// Docker Image OS info
type ImageOS struct {
Name string
Version string
PkgMgr string
PkgMgrDBLocation string
Name string // e.g. Debian
Version string // OS release
PkgMgr string // Package Mgr name e.g. dpkg
PkgMgrDBLocation string // Package manager DB location on filesystem
}
1 change: 1 addition & 0 deletions pkg/osvscanner/osvscanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func identifyImageOS(image *image.Image) (lockfile.ImageOS, error) {
filePath := file.Path("/etc/debian_version")
contentReader, err := image.FileContentsFromSquash(filePath)
// TODO: If err=file does not exist -> continue, otherwise stop parsing image now
// TODO: remove duplicate code
// Debian
if err == nil {
buf := new(bytes.Buffer)
Expand Down

0 comments on commit a418625

Please sign in to comment.