Skip to content

Commit

Permalink
Merge pull request #14 from neuroforgede/wip/setup_registry_auth#main
Browse files Browse the repository at this point in the history
tryfix: add serveraddress to distribution call
  • Loading branch information
s4ke authored Aug 9, 2024
2 parents 50100fc + 1606e79 commit 7fe059e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions swarmgate/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ try {
console.log(`Loading registry auth overrides from ${REGISTRY_AUTH_OVERRIDES_PATH}`);
const registryAuthOverridesRaw: RegistryAuthPerDockerRegistry = require(REGISTRY_AUTH_OVERRIDES_PATH);
for (const [registry, auth] of Object.entries(registryAuthOverridesRaw)) {
if (auth.serveraddress && auth.serveraddress !== registry) {
if (!auth.serveraddress) {
auth.serveraddress = registry;
}
registryAuthOverrides[registry] = auth;
Expand Down Expand Up @@ -133,7 +133,6 @@ export function setupRoutes(tenantLabelValue: string) {
}
}
}
console.log("using registry auth", req.headers['x-registry-auth']);
} catch (err) {
console.error("Failed injecting registry auth into headers", err);
res.writeHead(500);
Expand Down Expand Up @@ -183,7 +182,6 @@ export function setupRoutes(tenantLabelValue: string) {
serveraddress: registryAuth.serveraddress!,
email: registryAuth.email,
})).toString("base64url");
console.log("using registry auth", headers['x-registry-auth']);
}

const options = {
Expand Down Expand Up @@ -481,7 +479,7 @@ export function setupRoutes(tenantLabelValue: string) {
const response = await service.update({
username: registryAuth.auth.username!,
password: registryAuth.auth.password!,
serveraddress: registryAuth.registry,
serveraddress: registryAuth.auth.serveraddress!,
}, updateSpec);
res.json(response);
return;
Expand Down Expand Up @@ -1092,7 +1090,6 @@ export function setupRoutes(tenantLabelValue: string) {
});
res.send(ret);
} catch (error: any) {
console.log(error);
console.error(error);
res.status(500).json({ message: error.message });
}
Expand Down

0 comments on commit 7fe059e

Please sign in to comment.