Skip to content

Commit

Permalink
do not import "github.com/aquasecurity/trivy/pkg/fanal/image"
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed Feb 24, 2025
1 parent cdb6c8f commit 0a8b330
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/util/trivy/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"sync"
"time"

fimage "github.com/aquasecurity/trivy/pkg/fanal/image"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
dimage "github.com/docker/docker/api/types/image"
Expand Down Expand Up @@ -297,7 +296,12 @@ func (img *image) Name() string {
}

func (img *image) ID() (string, error) {
return fimage.ID(img)
// github.com/aquasecurity/trivy/pkg/fanal/image.ID(img)
h, err := img.ConfigName()
if err != nil {
return "", fmt.Errorf("unable to get the image ID: %w", err)
}
return h.String(), nil
}

func (img *image) Layers() ([]v1.Layer, error) {
Expand Down

0 comments on commit 0a8b330

Please sign in to comment.