From 320df389381c495814b7785cf80ec7df99067cd6 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 16 Oct 2024 01:09:36 +0200 Subject: [PATCH] add debug logs for getAuthForDockerImage --- swarmgate/routes.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/swarmgate/routes.ts b/swarmgate/routes.ts index f68986d..3e24ab0 100644 --- a/swarmgate/routes.ts +++ b/swarmgate/routes.ts @@ -50,7 +50,7 @@ try { console.error(`Failed to load registry auth overrides: ${error.message}`); } -function getRegistryFromDockerImage(image: string): string { +function getRegistryFromDockerImage(image) { const parts = image.split('/'); if (parts.length < 2) { return ''; @@ -67,11 +67,20 @@ function getAuthForDockerImage(image: string): { registry: string } { let registry = getRegistryFromDockerImage(image); + console.log(`detected registry: ${registry} for image ${image}`); if (!registry) { registry = 'docker.io'; } + const auth = getAuthForRegistry(registry); + console.log(`auth for registry ${registry}: ${JSON.stringify({ + anonymous: auth?.anonymous, + username: auth?.username, + email: auth?.email, + password: "***", + serveraddress: auth?.serveraddress + })}`); return { - auth: getAuthForRegistry(registry), + auth: auth, registry: registry }; }