@@ -126,10 +126,10 @@ func TestPushInsecureRegistry(t *testing.T) {
126
126
ref := info .registryAddress + "/test/push-insecure"
127
127
128
128
// create a command outside of the dind context so without the insecure registry configured
129
- cmd2 , cleanup2 := dockerCli .createTestCmd ()
130
- defer cleanup2 ()
131
- cmd2 .Command = dockerCli .Command ("app" , "push" , "--tag" , ref , filepath .Join ("testdata" , "push-pull" , "push-pull.dockerapp" ))
132
- icmd .RunCmd (cmd2 ).Assert (t , icmd.Expected {ExitCode : 1 })
129
+ cmdNoInsecureRegistry , cleanupNoInsecureRegistryCommand := dockerCli .createTestCmd ()
130
+ defer cleanupNoInsecureRegistryCommand ()
131
+ cmdNoInsecureRegistry .Command = dockerCli .Command ("app" , "push" , "--tag" , ref , filepath .Join ("testdata" , "push-pull" , "push-pull.dockerapp" ))
132
+ icmd .RunCmd (cmdNoInsecureRegistry ).Assert (t , icmd.Expected {ExitCode : 1 })
133
133
134
134
// run the push with the command inside dind context configured to allow access to the insecure registry
135
135
cmd := info .configuredCmd
@@ -234,21 +234,21 @@ func TestPushInstallBundle(t *testing.T) {
234
234
name := strings .Replace (t .Name (), "/" , "_" , 1 )
235
235
ref2 := ref + ":v0.42"
236
236
// Create a new command so the bundle store can be trashed before installing the app
237
- cmd2 , cleanup2 := dockerCli .createTestCmd ()
237
+ cmdIsolatedStore , cleanupIsolatedStore := dockerCli .createTestCmd ()
238
238
239
239
// Enter the same context as `cmd` to run commands within the same environment
240
- cmd2 .Command = dockerCli .Command ("context" , "create" , "swarm-context" , "--docker" , fmt .Sprintf (`"host=tcp://%s"` , info .swarmAddress ))
241
- icmd .RunCmd (cmd2 ).Assert (t , icmd .Success )
242
- cmd2 .Env = append (cmd2 .Env , "DOCKER_CONTEXT=swarm-context" )
240
+ cmdIsolatedStore .Command = dockerCli .Command ("context" , "create" , "swarm-context" , "--docker" , fmt .Sprintf (`"host=tcp://%s"` , info .swarmAddress ))
241
+ icmd .RunCmd (cmdIsolatedStore ).Assert (t , icmd .Success )
242
+ cmdIsolatedStore .Env = append (cmdIsolatedStore .Env , "DOCKER_CONTEXT=swarm-context" )
243
243
244
244
// bundle the app again but this time with a tag to store it into the bundle store
245
- cmd2 .Command = dockerCli .Command ("app" , "bundle" , "--tag" , ref2 , "-o" , bundleFile , filepath .Join ("testdata" , "push-pull" , "push-pull.dockerapp" ))
246
- icmd .RunCmd (cmd2 ).Assert (t , icmd .Success )
245
+ cmdIsolatedStore .Command = dockerCli .Command ("app" , "bundle" , "--tag" , ref2 , "-o" , bundleFile , filepath .Join ("testdata" , "push-pull" , "push-pull.dockerapp" ))
246
+ icmd .RunCmd (cmdIsolatedStore ).Assert (t , icmd .Success )
247
247
// Push the app without tagging it explicitly
248
- cmd2 .Command = dockerCli .Command ("app" , "push" , ref2 )
249
- icmd .RunCmd (cmd2 ).Assert (t , icmd .Success )
248
+ cmdIsolatedStore .Command = dockerCli .Command ("app" , "push" , ref2 )
249
+ icmd .RunCmd (cmdIsolatedStore ).Assert (t , icmd .Success )
250
250
// remove the bundle from the bundle store to be sure it won't be used instead of registry
251
- cleanup2 ()
251
+ cleanupIsolatedStore ()
252
252
// install from the registry
253
253
cmd .Command = dockerCli .Command ("app" , "install" , ref2 , "--name" , name )
254
254
icmd .RunCmd (cmd ).Assert (t , icmd .Success )
0 commit comments