File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments