cli/command/registry: rename some vars that collided with imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
cf89afb32b
commit
575e373669
@ -349,16 +349,16 @@ func TestLoginNonInteractive(t *testing.T) {
|
|||||||
// "" meaning default registry
|
// "" meaning default registry
|
||||||
registries := []string{"", "my-registry.com"}
|
registries := []string{"", "my-registry.com"}
|
||||||
|
|
||||||
for _, registry := range registries {
|
for _, registryAddr := range registries {
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(tc.doc, func(t *testing.T) {
|
t.Run(tc.doc, func(t *testing.T) {
|
||||||
tmpFile := fs.NewFile(t, "test-run-login")
|
tmpFile := fs.NewFile(t, "test-run-login")
|
||||||
defer tmpFile.Remove()
|
defer tmpFile.Remove()
|
||||||
cli := test.NewFakeCli(&fakeClient{})
|
cli := test.NewFakeCli(&fakeClient{})
|
||||||
configfile := cli.ConfigFile()
|
cfg := cli.ConfigFile()
|
||||||
configfile.Filename = tmpFile.Path()
|
cfg.Filename = tmpFile.Path()
|
||||||
options := loginOptions{
|
options := loginOptions{
|
||||||
serverAddress: registry,
|
serverAddress: registryAddr,
|
||||||
}
|
}
|
||||||
if tc.username {
|
if tc.username {
|
||||||
options.user = "my-username"
|
options.user = "my-username"
|
||||||
@ -412,26 +412,26 @@ func TestLoginNonInteractive(t *testing.T) {
|
|||||||
// "" meaning default registry
|
// "" meaning default registry
|
||||||
registries := []string{"", "my-registry.com"}
|
registries := []string{"", "my-registry.com"}
|
||||||
|
|
||||||
for _, registry := range registries {
|
for _, registryAddr := range registries {
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(tc.doc, func(t *testing.T) {
|
t.Run(tc.doc, func(t *testing.T) {
|
||||||
tmpFile := fs.NewFile(t, "test-run-login")
|
tmpFile := fs.NewFile(t, "test-run-login")
|
||||||
defer tmpFile.Remove()
|
defer tmpFile.Remove()
|
||||||
cli := test.NewFakeCli(&fakeClient{})
|
cli := test.NewFakeCli(&fakeClient{})
|
||||||
configfile := cli.ConfigFile()
|
cfg := cli.ConfigFile()
|
||||||
configfile.Filename = tmpFile.Path()
|
cfg.Filename = tmpFile.Path()
|
||||||
serverAddress := registry
|
serverAddress := registryAddr
|
||||||
if serverAddress == "" {
|
if serverAddress == "" {
|
||||||
serverAddress = "https://index.docker.io/v1/"
|
serverAddress = "https://index.docker.io/v1/"
|
||||||
}
|
}
|
||||||
assert.NilError(t, configfile.GetCredentialsStore(serverAddress).Store(configtypes.AuthConfig{
|
assert.NilError(t, cfg.GetCredentialsStore(serverAddress).Store(configtypes.AuthConfig{
|
||||||
Username: "my-username",
|
Username: "my-username",
|
||||||
Password: "my-password",
|
Password: "my-password",
|
||||||
ServerAddress: serverAddress,
|
ServerAddress: serverAddress,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
options := loginOptions{
|
options := loginOptions{
|
||||||
serverAddress: registry,
|
serverAddress: registryAddr,
|
||||||
}
|
}
|
||||||
if tc.username {
|
if tc.username {
|
||||||
options.user = "my-username"
|
options.user = "my-username"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user