mirror of
https://github.com/docker/cli.git
synced 2026-11-06 13:10:41 -04:00
internal/test: keep FakeCli from contacting Docker Desktop
Tests that use FakeCli pull, push, and create containers through RetrieveAuthTokenFromImage. Disable the Docker Desktop lookup, so that they never reach the Docker Desktop of the machine they run on. Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
manifeststore "github.com/docker/cli/cli/manifest/store"
|
||||
"github.com/docker/cli/cli/streams"
|
||||
"github.com/docker/cli/internal/registryclient"
|
||||
"github.com/docker/cli/internal/secretsengine"
|
||||
"github.com/moby/moby/client"
|
||||
)
|
||||
|
||||
@@ -35,6 +36,7 @@ type FakeCli struct {
|
||||
|
||||
// NewFakeCli returns a fake for the command.Cli interface
|
||||
func NewFakeCli(apiClient client.APIClient, opts ...func(*FakeCli)) *FakeCli {
|
||||
secretsengine.Disable()
|
||||
outBuffer := new(bytes.Buffer)
|
||||
errBuffer := new(bytes.Buffer)
|
||||
c := &FakeCli{
|
||||
|
||||
Reference in New Issue
Block a user