forked from toolshed/abra
WIP: foundations for app deploy
This commit is contained in:
@ -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"
|
||||
}
|
||||
|
Reference in New Issue
Block a user