From ea6e4d55b0540ef0d8d9b809181f896c1f45a1b8 Mon Sep 17 00:00:00 2001 From: Andrei Pohilko Date: Tue, 20 Sep 2022 12:41:06 +0100 Subject: [PATCH] Fix wrong deployemnt status --- pkg/dashboard/data.go | 9 +++++++++ pkg/dashboard/static/scripts.js | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/dashboard/data.go b/pkg/dashboard/data.go index 668978d..ac3b5ee 100644 --- a/pkg/dashboard/data.go +++ b/pkg/dashboard/data.go @@ -321,6 +321,15 @@ func (d *DataLayer) GetResource(namespace string, def *GenericResource) (*Generi } sort.Slice(res.Status.Conditions, func(i, j int) bool { + // some condition types always bubble up + if res.Status.Conditions[i].Type == "Available" { + return false + } + + if res.Status.Conditions[j].Type == "Available" { + return true + } + t1 := res.Status.Conditions[i].LastTransitionTime t2 := res.Status.Conditions[j].LastTransitionTime return t1.Time.Before(t2.Time) diff --git a/pkg/dashboard/static/scripts.js b/pkg/dashboard/static/scripts.js index 4258be7..63467db 100644 --- a/pkg/dashboard/static/scripts.js +++ b/pkg/dashboard/static/scripts.js @@ -305,7 +305,6 @@ function popUpUpgrade(self, verCur, elm) { let url = "/api/helm/charts/install?namespace=" + getHashParam("namespace") + "&name=" + name + "&chart=" + elm.name; $('#upgradeModalLabel select').data("url", url) - self.prop("disabled", true) $("#upgradeModalLabel .name").text(name) $("#upgradeModalLabel .ver-old").text(verCur)