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:
Alano Terblanche
2026-10-22 11:22:04 +02:00
parent f59d490370
commit 1afa7ac002
+2
View File
@@ -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{