From f35fb0f5a6f0319e36fe055e016222b56fc6eb95 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 2 Feb 2026 16:06:52 +0100 Subject: [PATCH] cli/command: TestGetDefaultAuthConfig: cleanup test file Prevent a `cli/command/filename` file being left behind after running tests. Signed-off-by: Sebastiaan van Stijn --- cli/command/registry_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/command/registry_test.go b/cli/command/registry_test.go index 91372ad56eb1..751711f36391 100644 --- a/cli/command/registry_test.go +++ b/cli/command/registry_test.go @@ -3,6 +3,7 @@ package command_test import ( "bytes" "path" + "path/filepath" "testing" "github.com/docker/cli/cli/command" @@ -58,7 +59,9 @@ func TestGetDefaultAuthConfig(t *testing.T) { expectedAuthConfig: testAuthConfigs[1], }, } - cfg := configfile.New("filename") + + tmpDir := t.TempDir() + cfg := configfile.New(filepath.Join(tmpDir, "cli-config.json")) for _, authConfig := range testAuthConfigs { assert.Check(t, cfg.GetCredentialsStore(authConfig.ServerAddress).Store(configtypes.AuthConfig{ Username: authConfig.Username,