mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
fix test
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestExtract(t *testing.T) {
|
||||
func TestExtractFromFile(t *testing.T) {
|
||||
vectors := []struct {
|
||||
file string // Test input file
|
||||
filenames []string // Target files
|
||||
@@ -52,7 +52,7 @@ func TestExtract(t *testing.T) {
|
||||
defer f.Close()
|
||||
|
||||
d := DockerExtractor{}
|
||||
fm, err := d.Extract(f, v.filenames)
|
||||
fm, err := d.ExtractFromFile(nil, f, v.filenames)
|
||||
if v.err != err {
|
||||
t.Errorf("err: got %v, want %v", v.err, err)
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ import (
|
||||
"encoding/base64"
|
||||
"strings"
|
||||
|
||||
"github.com/prometheus/common/log"
|
||||
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"log"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/ecr"
|
||||
"github.com/docker/docker/api/types"
|
||||
@@ -34,7 +34,7 @@ func GetToken(ctx context.Context, auth types.AuthConfig) types.AuthConfig {
|
||||
username, password, err = GetGCRAuthorizationToken(ctx)
|
||||
}
|
||||
if err != nil {
|
||||
log.Debugf("failed to get token: %w", err)
|
||||
log.Printf("failed to get token: %s", err)
|
||||
}
|
||||
auth.Username = username
|
||||
auth.Password = password
|
||||
|
||||
Reference in New Issue
Block a user