Skip to content

Commit

Permalink
fix: small syft fix
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kotzbauer <git@ckotzbauer.de>
  • Loading branch information
ckotzbauer committed Jan 27, 2022
1 parent ed59b5a commit 9fab42b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/syft/syft.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ func (s *Syft) ExecuteSyft(img kubernetes.ImageDigest) (string, error) {
filePath := strings.ReplaceAll(img.Digest, "@", "/")
filePath = strings.ReplaceAll(path.Join(s.GitWorkingTree, s.GitPath, filePath, fileName), ":", "_")

if util.PathExists(filePath) {
logrus.Debugf("Skip image %s", img.Digest)
return filePath, nil
}

logrus.Debugf("Processing image %s", img.Digest)

workDir := "/tmp/" + util.RandStringBytes(10)
Expand All @@ -57,7 +52,7 @@ func (s *Syft) ExecuteSyft(img kubernetes.ImageDigest) (string, error) {
return "", err
}

src, cleanup, err := source.New(filepath.Join("oci-archive:", imagePath), nil, nil)
src, cleanup, err := source.New(filepath.Join("file:", imagePath), nil, nil)
if err != nil {
logrus.WithError(fmt.Errorf("failed to construct source from input %s: %w", imagePath, err)).Error("Source-Creation failed")
return "", err
Expand Down

0 comments on commit 9fab42b

Please sign in to comment.