Skip to content

Commit

Permalink
add support to scan tar (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibreakthecloud authored Jul 19, 2024
1 parent fd1f41e commit 4eebaee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func StartYaraHunter[T any](ctx context.Context,
opts.FailOnCompileWarning, config, constants.PluginName,
)
if err != nil {
log.Fatal("Cannot init grpc")
log.Fatalf("Cannot init grpc: %v", err)
}
go func() {

Expand Down
5 changes: 5 additions & 0 deletions pkg/scan/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const (
DirScan ScanType = iota
ImageScan
ContainerScan
TarScan
)

func ScanTypeString(st ScanType) string {
Expand All @@ -54,6 +55,8 @@ func ScanTypeString(st ScanType) string {
return "image"
case ContainerScan:
return "container"
case TarScan:
return "tar"
}
return ""
}
Expand All @@ -75,6 +78,8 @@ func (s *Scanner) Scan(ctx *tasks.ScanContext, stype ScanType, namespace, id str
extract, err = extractor.NewImageExtractor(s.Filters, namespace, id)
case ContainerScan:
extract, err = extractor.NewContainerExtractor(s.Filters, namespace, id)
case TarScan:
extract, err = extractor.NewTarExtractor(s.Filters, namespace, id)

Check failure on line 82 in pkg/scan/scanner.go

View workflow job for this annotation

GitHub Actions / lint

undefined: extractor.NewTarExtractor (typecheck)

Check failure on line 82 in pkg/scan/scanner.go

View workflow job for this annotation

GitHub Actions / lint

undefined: extractor.NewTarExtractor) (typecheck)

Check failure on line 82 in pkg/scan/scanner.go

View workflow job for this annotation

GitHub Actions / lint

undefined: extractor.NewTarExtractor) (typecheck)
default:
err = fmt.Errorf("invalid request")
}
Expand Down

0 comments on commit 4eebaee

Please sign in to comment.