AppManager: improve installation status page
* Status is refreshed in the background
* Render release item infos instead of internal names
Change-Id: I63a6082656e4e6772a4b5c734c5dd5c23141f70b
diff --git a/core/installer/app_manager.go b/core/installer/app_manager.go
index 9ee9671..612f9a7 100644
--- a/core/installer/app_manager.go
+++ b/core/installer/app_manager.go
@@ -201,6 +201,7 @@
type Resource struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
+ Info string `json:"info"`
}
type ReleaseResources struct {
@@ -366,9 +367,13 @@
}
type helmRelease struct {
- Metadata Resource `json:"metadata"`
- Kind string `json:"kind"`
- Status struct {
+ Metadata struct {
+ Name string `json:"name"`
+ Namespace string `json:"namespace"`
+ Annotations map[string]string `json:"annotations"`
+ } `json:"metadata"`
+ Kind string `json:"kind"`
+ Status struct {
Conditions []struct {
Type string `json:"type"`
Status string `json:"status"`
@@ -384,7 +389,18 @@
panic(err) // TODO(gio): handle
}
if h.Kind == "HelmRelease" {
- ret = append(ret, h.Metadata)
+ res := Resource{
+ Name: h.Metadata.Name,
+ Namespace: h.Metadata.Namespace,
+ Info: fmt.Sprintf("%s/%s", h.Metadata.Namespace, h.Metadata.Name),
+ }
+ if h.Metadata.Annotations != nil {
+ info, ok := h.Metadata.Annotations["dodo.cloud/installer-info"]
+ if ok && len(info) != 0 {
+ res.Info = info
+ }
+ }
+ ret = append(ret, res)
}
}
return ret