Skip to content
Snippets Groups Projects
Commit 13ca5d66 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: actively handle 401 auth deny from docker registries

parent 533f866c
No related branches found
No related tags found
No related merge requests found
......@@ -136,6 +136,19 @@ async function getTags(registry, name) {
logger.trace({ tags });
return tags;
} catch (err) /* istanbul ignore next */ {
logger.debug(
{
err,
name,
message: err.message,
body: err.response ? err.response.body : undefined,
},
'docker.getTags() error'
);
if (err.statusCode === 401) {
logger.info('Not authorised to look up docker tags');
return null;
}
if (err.statusCode >= 500 && err.statusCode < 600) {
logger.warn({ err }, 'docker registry failure: internal error');
throw new Error('registry-failure');
......@@ -148,7 +161,7 @@ async function getTags(registry, name) {
logger.debug({ err });
return null;
}
logger.info({ err, name }, 'Warning: Error getting docker image tags');
logger.warn('Error getting docker image tags');
return null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment