@@ -19,63 +19,12 @@ package docker
19
19
import (
20
20
"context"
21
21
"fmt"
22
- "io/ioutil"
23
- "path/filepath"
24
22
"testing"
25
23
26
24
"github.com/GoogleContainerTools/skaffold/testutil"
27
- "github.com/docker/cli/cli/config"
28
25
"github.com/docker/docker/api/types"
29
26
)
30
27
31
- const dockerCfg = `{
32
- "auths": {
33
- "https://appengine.gcr.io": {},
34
- "https://asia.gcr.io": {},
35
- "https://b.gcr.io": {},
36
- "https://beta.gcr.io": {},
37
- "https://bucket.gcr.io": {},
38
- "https://eu.gcr.io": {},
39
- "https://gcr.io": {},
40
- "https://gcr.kubernetes.io": {},
41
- "https://us.gcr.io": {}
42
- },
43
- "credsStore": "gcr",
44
- "credHelpers": {
45
- "appengine.gcr.io": "gcr",
46
- "asia.gcr.io": "gcr",
47
- "eu.gcr.io": "gcr",
48
- "gcr.io": "gcr",
49
- "gcr.kubernetes.io": "gcr",
50
- "us.gcr.io": "gcr"
51
- }
52
- }`
53
-
54
- func TestLoad (t * testing.T ) {
55
- tempDir , cleanup := testutil .TempDir (t )
56
- defer cleanup ()
57
-
58
- defer func (d string ) { configDir = d }(configDir )
59
- configDir = tempDir
60
-
61
- ioutil .WriteFile (filepath .Join (configDir , config .ConfigFileName ), []byte (dockerCfg ), 0650 )
62
-
63
- _ , err := load ()
64
- if err != nil {
65
- t .Errorf ("Couldn't load docker config: %s" , err )
66
- }
67
- }
68
-
69
- func TestLoadNotARealPath (t * testing.T ) {
70
- defer func (d string ) { configDir = d }(configDir )
71
- configDir = "not a real path"
72
-
73
- cf , err := load ()
74
- if err == nil {
75
- t .Errorf ("Expected error loading from bad path, but got none: %+v" , cf )
76
- }
77
- }
78
-
79
28
type testAuthHelper struct {
80
29
getAuthConfigErr error
81
30
getAllAuthConfigsErr error
0 commit comments