AppManager: App installation status monitoring
Change-Id: I64f4ae0d27892b74f8827a275907cb75da09a758
diff --git a/core/installer/app_manager.go b/core/installer/app_manager.go
index e6133c1..7995a41 100644
--- a/core/installer/app_manager.go
+++ b/core/installer/app_manager.go
@@ -81,6 +81,11 @@
}
}
+func (m *AppManager) AppRendered(instanceId string) ([]byte, error) {
+ path := filepath.Join(m.appDirRoot, instanceId, "rendered.json")
+ return soft.ReadFile(m.repo, path)
+}
+
func (m *AppManager) GetAllInstances() ([]AppInstanceConfig, error) {
m.repo.Pull()
kust, err := soft.ReadKustomization(m.repo, filepath.Join(m.appDirRoot, kustomizationFileName))
@@ -317,6 +322,7 @@
}
type Resource struct {
+ Id string `json:"id"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Info string `json:"info"`
@@ -599,7 +605,7 @@
Name: h.Metadata.Name,
Namespace: h.Metadata.Namespace,
Info: fmt.Sprintf("%s/%s", h.Metadata.Namespace, h.Metadata.Name),
- Annotations: nil,
+ Annotations: h.Metadata.Annotations,
}
if h.Metadata.Annotations != nil {
res.Annotations = h.Metadata.Annotations
@@ -607,6 +613,10 @@
if ok && len(info) != 0 {
res.Info = info
}
+ id, ok := h.Metadata.Annotations["dodo.cloud/id"]
+ if ok && len(id) != 0 {
+ res.Id = id
+ }
}
ret = append(ret, res)
}