Skip to content

Commit 320df38

Browse files
committed
add debug logs for getAuthForDockerImage
1 parent 5815132 commit 320df38

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

swarmgate/routes.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ try {
5050
console.error(`Failed to load registry auth overrides: ${error.message}`);
5151
}
5252

53-
function getRegistryFromDockerImage(image: string): string {
53+
function getRegistryFromDockerImage(image) {
5454
const parts = image.split('/');
5555
if (parts.length < 2) {
5656
return '';
@@ -67,11 +67,20 @@ function getAuthForDockerImage(image: string): {
6767
registry: string
6868
} {
6969
let registry = getRegistryFromDockerImage(image);
70+
console.log(`detected registry: ${registry} for image ${image}`);
7071
if (!registry) {
7172
registry = 'docker.io';
7273
}
74+
const auth = getAuthForRegistry(registry);
75+
console.log(`auth for registry ${registry}: ${JSON.stringify({
76+
anonymous: auth?.anonymous,
77+
username: auth?.username,
78+
email: auth?.email,
79+
password: "***",
80+
serveraddress: auth?.serveraddress
81+
})}`);
7382
return {
74-
auth: getAuthForRegistry(registry),
83+
auth: auth,
7584
registry: registry
7685
};
7786
}

0 commit comments

Comments
 (0)