Skip to content

Commit

Permalink
fix(docker): treat docker hub 401 as external host error
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Feb 3, 2021
1 parent 7519b76 commit 3cb2553
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/datasource/docker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,14 @@ async function getTags(
);
throw new ExternalHostError(err);
}
// prettier-ignore
if (err.statusCode === 401 && registry.endsWith('docker.io')) { // lgtm [js/incomplete-url-substring-sanitization]
logger.warn(
{ registry, dockerRepository: repository, err },
'docker registry failure: unauthorized'
);
throw new ExternalHostError(err);
}
if (err.statusCode >= 500 && err.statusCode < 600) {
logger.warn(
{ registry, dockerRepository: repository, err },
Expand Down

0 comments on commit 3cb2553

Please sign in to comment.