From a7d1f5a73b60b055a869c341f1d7888f7762514a Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Sat, 5 Jan 2019 19:27:25 +0100
Subject: [PATCH] refactor: docker datasource registry

---
 lib/datasource/docker/index.js | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/datasource/docker/index.js b/lib/datasource/docker/index.js
index 6a8345323b..71a9a9d309 100644
--- a/lib/datasource/docker/index.js
+++ b/lib/datasource/docker/index.js
@@ -190,19 +190,19 @@ async function getManifestResponse(registry, repository, tag) {
 async function getDigest(config, newValue) {
   const { dockerRegistry, depName } = config;
   logger.debug(`getDigest(${dockerRegistry}, ${depName}, ${newValue})`);
-  const massagedRegistry = massageRegistry(dockerRegistry, config.registryUrls);
+  const registry = massageRegistry(dockerRegistry, config.registryUrls);
   const repository = getRepository(depName, dockerRegistry);
   const newTag = newValue || 'latest';
   try {
     const cacheNamespace = 'datasource-docker-digest';
-    const cacheKey = `${massagedRegistry}:${repository}:${newTag}`;
+    const cacheKey = `${registry}:${repository}:${newTag}`;
     const cachedResult = await renovateCache.get(cacheNamespace, cacheKey);
     // istanbul ignore if
     if (cachedResult) {
       return cachedResult;
     }
     const manifestResponse = await getManifestResponse(
-      massagedRegistry,
+      registry,
       repository,
       newTag
     );
@@ -316,10 +316,9 @@ async function getTags(registry, repository) {
 
 async function getPkgReleases(purl, config = {}) {
   const { fullname, qualifiers } = purl;
-  const { registry } = qualifiers;
-  const massagedRegistry = massageRegistry(registry, config.registryUrls);
-  const repository = getRepository(fullname, registry);
-  const tags = await getTags(massagedRegistry, repository);
+  const registry = massageRegistry(qualifiers.registry, config.registryUrls);
+  const repository = getRepository(fullname, qualifiers.registry);
+  const tags = await getTags(registry, repository);
   if (!tags) {
     return null;
   }
-- 
GitLab