@@ -675,6 +675,9 @@ var _ = Describe("e2e vmdistributedcluster", Label("vm", "vmdistributedcluster")
675675 Expect (k8sClient .Get (ctx , namespacedName , cr )).To (Succeed ())
676676 cr .Spec .Paused = false
677677 Expect (k8sClient .Update (ctx , cr )).To (Succeed ())
678+ Eventually (func () error {
679+ return expectObjectStatusOperational (ctx , k8sClient , & vmv1alpha1.VMDistributedCluster {}, namespacedName )
680+ }, eventualStatefulsetAppReadyTimeout ).Should (Succeed ())
678681
679682 By ("verifying reconciliation resumes after unpausing" )
680683 Eventually (func () int32 {
@@ -862,14 +865,29 @@ var _ = Describe("e2e vmdistributedcluster", Label("vm", "vmdistributedcluster")
862865 }
863866 Expect (k8sClient .Create (ctx , cr )).To (Succeed ())
864867 var inlineVMClusters []vmv1beta1.VMCluster
868+ var refs []vmv1beta1.TargetRef
865869 for _ , zone := range cr .Spec .Zones {
866870 inlineVMClusters = append (inlineVMClusters , vmv1beta1.VMCluster {
867871 ObjectMeta : metav1.ObjectMeta {
868872 Name : zone .Name ,
869873 Namespace : namespace ,
870874 },
871875 })
876+ refs = append (refs , vmv1beta1.TargetRef {
877+ CRD : & vmv1beta1.CRDRef {
878+ Kind : "VMCluster/vmselect" ,
879+ Name : zone .Name ,
880+ Namespace : namespace ,
881+ },
882+ TargetPathSuffix : "/select/1" ,
883+ })
872884 }
885+
886+ // Update all VMUsers with the target refs
887+ updateVMUserTargetRefs (ctx , k8sClient , validVMUserNames , refs )
888+ Eventually (func () error {
889+ return expectObjectStatusOperational (ctx , k8sClient , & vmv1alpha1.VMDistributedCluster {}, namespacedName )
890+ }, eventualStatefulsetAppReadyTimeout ).WithContext (ctx ).Should (Succeed ())
873891 verifyOwnerReferences (ctx , cr , inlineVMClusters , namespace )
874892 DeferCleanup (func () {
875893 Expect (finalize .SafeDeleteWithFinalizer (ctx , k8sClient , cr )).To (Succeed ())
0 commit comments