Skip to content

Commit

Permalink
change file REGISTRY_AUTH_OVERRIDES_PATH loading to not use require
Browse files Browse the repository at this point in the history
  • Loading branch information
s4ke committed Oct 15, 2024
1 parent 87fcca8 commit 5815132
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swarmgate/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ try {
const overrideExists = fs.existsSync(REGISTRY_AUTH_OVERRIDES_PATH);
if (overrideExists) {
console.log(`Loading registry auth overrides from ${REGISTRY_AUTH_OVERRIDES_PATH}`);
const registryAuthOverridesRaw: RegistryAuthPerDockerRegistry = require(REGISTRY_AUTH_OVERRIDES_PATH);
const fileContents = fs.readFileSync(REGISTRY_AUTH_OVERRIDES_PATH, 'utf8');
const registryAuthOverridesRaw: RegistryAuthPerDockerRegistry = JSON.parse(fileContents);
for (const [registry, auth] of Object.entries(registryAuthOverridesRaw)) {
registryAuthOverrides[registry] = auth;
}
Expand Down

0 comments on commit 5815132

Please sign in to comment.