From 4e9bad9ef05cfbb5c09ea6c21795ab0f1402fbe7 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 30 Oct 2024 16:51:02 +0100 Subject: [PATCH] docker auth: add no auth test --- .../docker/docker_manager/docker_auth_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth_test.go b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth_test.go index 1f328911e2..efc7b6d0b5 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth_test.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth_test.go @@ -27,6 +27,13 @@ func writeStaticConfig(t *testing.T, configContent string) string { return tmpDir } +func TestGetNoAuth(t *testing.T) { + os.Setenv(ENV_DOCKER_CONFIG, "/does/not/exist") + authConfig, err := GetAuthFromDockerConfig("my-repo/my-image:latest") + assert.NoError(t, err) + assert.Nil(t, authConfig, "Auth config should be nil") +} + func TestGetAuthConfigForRepoPlain(t *testing.T) { expectedUser := "user" expectedPassword := "password"