From ee4916cbf550d50aede71a3854a67dd1c90ac206 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Wed, 5 Aug 2020 15:22:13 +0200 Subject: [PATCH] Add test for invalid registry name --- aci/convert/registrycredentials_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aci/convert/registrycredentials_test.go b/aci/convert/registrycredentials_test.go index 225129827..ee3eaf839 100644 --- a/aci/convert/registrycredentials_test.go +++ b/aci/convert/registrycredentials_test.go @@ -61,6 +61,15 @@ func TestRegistryNameWithoutProtocol(t *testing.T) { }) } +func TestInvalidCredentials(t *testing.T) { + loader := &MockRegistryLoader{} + loader.On(getAllCredentials).Return(registry("18.195.159.6:444", userPwdCreds("toto", "pwd")), nil) + + creds, err := getRegistryCredentials(composeServices("gtardif/privateimg"), loader) + assert.NilError(t, err) + assert.Equal(t, len(creds), 0) +} + func TestImageWithDotInName(t *testing.T) { loader := &MockRegistryLoader{} loader.On(getAllCredentials).Return(registry("index.docker.io", userPwdCreds("toto", "pwd")), nil)