Skip to content

Commit 29bb5f5

Browse files
committed
Wait for ArgoCD instance to be available before deploying application in gitopsservice_test.go file
Signed-off-by: NAVEENA S <nas@redhat.com>
1 parent 6e2a9aa commit 29bb5f5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/e2e/gitopsservice_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,24 @@ var _ = Describe("GitOpsServiceController", func() {
361361
return nil
362362
}, time.Minute*10, interval).ShouldNot(HaveOccurred())
363363

364+
// Wait for the ArgoCD instance to be available before proceeding
365+
// This ensures the instance is fully ready to process applications
366+
Eventually(func() error {
367+
argoCD := &argoapp.ArgoCD{
368+
ObjectMeta: metav1.ObjectMeta{
369+
Name: argocdInstance,
370+
Namespace: sourceNS,
371+
},
372+
}
373+
if err := k8sClient.Get(context.TODO(), client.ObjectKeyFromObject(argoCD), argoCD); err != nil {
374+
return err
375+
}
376+
if argoCD.Status.Phase != "Available" {
377+
return fmt.Errorf("ArgoCD instance is not yet Available, current phase: %s", argoCD.Status.Phase)
378+
}
379+
return nil
380+
}, time.Minute*10, interval).ShouldNot(HaveOccurred())
381+
364382
// create a target namespace to deploy resources
365383
// allow argocd to create resources in the target namespace by adding managed-by label
366384
targetNamespaceObj := &corev1.Namespace{

0 commit comments

Comments
 (0)