WIP: foundations for app deploy

This commit is contained in:
2021-08-03 08:49:16 +01:00
parent b351760f6e
commit 239c925d66
14 changed files with 2881 additions and 40 deletions

View File

@ -8,7 +8,8 @@ import (
"path"
"strings"
"coopcloud.tech/abra/client"
"coopcloud.tech/abra/client/convert"
"coopcloud.tech/abra/client/stack"
)
// Type aliases to make code hints easier to understand
@ -200,10 +201,10 @@ func SanitiseAppName(name string) string {
// GetAppStatuses queries servers to check the deployment status of given apps
func GetAppStatuses(appFiles AppFiles) (map[string]string, error) {
servers := appFiles.GetServers()
ch := make(chan client.StackStatus, len(servers))
ch := make(chan stack.StackStatus, len(servers))
for _, server := range servers {
go func(s string) {
ch <- client.QueryStackStatus(s)
ch <- stack.GetAllDeployedServices(s)
}(server)
}
@ -211,7 +212,7 @@ func GetAppStatuses(appFiles AppFiles) (map[string]string, error) {
for range servers {
status := <-ch
for _, service := range status.Services {
name := service.Spec.Labels[client.StackNamespace]
name := service.Spec.Labels[convert.LabelNamespace]
if _, ok := statuses[name]; !ok {
statuses[name] = "deployed"
}