Skip to content

Commit

Permalink
test cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Quest <[email protected]>
  • Loading branch information
kcq committed Aug 31, 2024
1 parent 64c65a8 commit bf4ba57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion pkg/app/master/inspectors/image/extract_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package image
import (
"reflect"
"testing"

"github.com/mintoolkit/mint/pkg/crt"
)

func TestRegistryExtraction(t *testing.T) {
Expand Down Expand Up @@ -30,7 +32,7 @@ func TestRegistryExtraction(t *testing.T) {
}

for _, test := range tt {
registry := extractRegistry(test.in)
registry := crt.ExtractRegistry(test.in)
if !equal(registry, test.expected) {
t.Errorf("got %s expected %s", registry, test.expected)
}
Expand Down
7 changes: 3 additions & 4 deletions pkg/app/master/inspectors/image/image_inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"path/filepath"
"strings"

//docker "github.com/fsouza/go-dockerclient"
log "github.com/sirupsen/logrus"

"github.com/mintoolkit/mint/pkg/consts"
Expand Down Expand Up @@ -116,7 +115,7 @@ func (i *Inspector) Pull(showPullLog bool, dockerConfigPath, registryAccount, re
}

var err error
var authConfig crt.AuthConfig // *docker.AuthConfiguration
var authConfig crt.AuthConfig
registry := crt.ExtractRegistry(repo)
authConfig, err = i.APIClient.GetRegistryAuthConfig(registryAccount, registrySecret, dockerConfigPath, registry)
if err != nil {
Expand Down Expand Up @@ -145,15 +144,15 @@ func (i *Inspector) Inspect() error {
var err error
i.ImageInfo, err = i.APIClient.InspectImage(i.ImageRef)
if err != nil {
if err == crt.ErrNotFound { // docker.ErrNoSuchImage {
if err == crt.ErrNotFound {
log.Infof("could not find target image - i.ImageRef='%s'", i.ImageRef)
}
return err
}

log.Tracef("image.Inspector.Inspect: ImageInfo=%#v", i.ImageInfo)

imageList, err := i.APIClient.ListImagesAll() // i.APIClient.ListImages(docker.ListImagesOptions{All: true})
imageList, err := i.APIClient.ListImagesAll()
if err != nil {
return err
}
Expand Down

0 comments on commit bf4ba57

Please sign in to comment.