From e726b47648af0e3256cd4b647a957c680df09934 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 7 Dec 2018 09:16:58 +0100
Subject: [PATCH] chore: refactor docker tags datasource

---
 lib/datasource/docker.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/datasource/docker.js b/lib/datasource/docker.js
index c2c094284d..38bcc79542 100644
--- a/lib/datasource/docker.js
+++ b/lib/datasource/docker.js
@@ -302,11 +302,13 @@ async function getPkgReleases(purl, config = {}) {
   if (!tags) {
     return null;
   }
-  const releases = tags
+  const sortedTags = tags
     .filter(tag => !suffix || tag.endsWith(`-${suffix}`))
     .map(tag => (suffix ? tag.replace(new RegExp(`-${suffix}$`), '') : tag))
     .filter(isVersion)
-    .sort(sortVersions)
-    .map(version => ({ version }));
-  return { releases };
+    .sort(sortVersions);
+
+  const releases = sortedTags.map(version => ({ version }));
+  const ret = { releases };
+  return ret;
 }
-- 
GitLab