From 245863b2f9b6d65e8faff723a1764b9d13ec837d Mon Sep 17 00:00:00 2001 From: Harshit Mehta Date: Fri, 14 Apr 2023 16:07:31 +0530 Subject: [PATCH] bug: fix sorting of release versions (#336) Signed-off-by: Harshit Mehta --- pkg/dashboard/static/actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dashboard/static/actions.js b/pkg/dashboard/static/actions.js index 0db66c0..a0788a8 100644 --- a/pkg/dashboard/static/actions.js +++ b/pkg/dashboard/static/actions.js @@ -91,7 +91,7 @@ function popUpUpgrade(elm, ns, name, verCur, lastRev) { $.getJSON("/api/helm/repositories/versions?name=" + elm.name).fail(function (xhr) { reportError("Failed to find chart in repo", xhr) }).done(function (vers) { - vers.sort((b, a) => (a.version > b.version) - (a.version < b.version)) + vers = vers.map( a => a.split('.').map( n => +n+100000 ).join('.') ).sort().map( a => a.split('.').map( n => +n-100000 ).join('.') ); // fill versions $('#upgradeModal select').empty()