From b2921d80591205a59031b93f0e788647c3b6096b Mon Sep 17 00:00:00 2001 From: David Ragot Date: Fri, 23 Feb 2024 12:31:35 +0100 Subject: [PATCH] feat: ready on expected modules ready --- ee/agent/internal/informer_stacks.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ee/agent/internal/informer_stacks.go b/ee/agent/internal/informer_stacks.go index 8440992754..b2960db68a 100644 --- a/ee/agent/internal/informer_stacks.go +++ b/ee/agent/internal/informer_stacks.go @@ -7,6 +7,22 @@ import ( "k8s.io/client-go/tools/cache" ) +func getExpectedModules() []string { + return []string{ + "stargate", + "gateway", + "auth", + "ledger", + "payments", + "reconcillation", + "wallets", + "search", + "reconciliation", + "orchestration", + "webhooks", + } +} + func StacksEventHandler(logger sharedlogging.Logger, membershipClient MembershipClient) cache.ResourceEventHandlerFuncs { sendStatus := func(stack string, status generated.StackStatus) { if err := membershipClient.Send(&generated.Message{ @@ -28,7 +44,11 @@ func StacksEventHandler(logger sharedlogging.Logger, membershipClient Membership } if stack.Status.Ready { - return generated.StackStatus_Ready + if len(stack.Status.Modules) == len(getExpectedModules()) { + return generated.StackStatus_Ready + } else { + return generated.StackStatus_Progressing + } } else { return generated.StackStatus_Progressing }