@@ -54,7 +54,7 @@ func TestAddFinalizer(t *testing.T) {
5454 // given
5555 memberClient := commontest .NewFakeClient (t )
5656 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space )
57- InitializeCounters (t , NewToolchainStatus (
57+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
5858 WithMember (commontest .MemberClusterName ),
5959 WithMetric (toolchainv1alpha1 .MasterUserRecordsPerDomainMetricKey , toolchainv1alpha1.Metric {
6060 string (metrics .Internal ): 1 ,
@@ -89,7 +89,7 @@ func TestAddFinalizer(t *testing.T) {
8989 // given
9090 memberClient := commontest .NewFakeClient (t )
9191 hostClient := commontest .NewFakeClient (t , mur )
92- InitializeCounters (t , NewToolchainStatus (
92+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
9393 WithMember (commontest .MemberClusterName ),
9494 WithMetric (toolchainv1alpha1 .MasterUserRecordsPerDomainMetricKey , toolchainv1alpha1.Metric {
9595 string (metrics .Internal ): 1 ,
@@ -126,7 +126,7 @@ func TestAddFinalizer(t *testing.T) {
126126 murSkipSpace .Annotations [toolchainv1alpha1 .SkipAutoCreateSpaceAnnotationKey ] = "true"
127127 memberClient := commontest .NewFakeClient (t )
128128 hostClient := commontest .NewFakeClient (t , murSkipSpace , signup , userTier )
129- InitializeCounters (t , NewToolchainStatus (
129+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
130130 WithMember (commontest .MemberClusterName ),
131131 WithMetric (toolchainv1alpha1 .MasterUserRecordsPerDomainMetricKey , toolchainv1alpha1.Metric {
132132 string (metrics .Internal ): 1 ,
@@ -164,7 +164,7 @@ func TestAddFinalizer(t *testing.T) {
164164 hostClient .MockUpdate = func (ctx context.Context , obj runtimeclient.Object , opts ... runtimeclient.UpdateOption ) error {
165165 return fmt .Errorf ("unable to add finalizer to MUR %s" , mur .Name )
166166 }
167- InitializeCounters (t , NewToolchainStatus (
167+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
168168 WithMember (commontest .MemberClusterName ),
169169 WithMetric (toolchainv1alpha1 .UserSignupsPerActivationAndDomainMetricKey , toolchainv1alpha1.Metric {
170170 "1,internal" : 1 ,
@@ -211,7 +211,7 @@ func TestCreateUserAccountSuccessful(t *testing.T) {
211211 require .NoError (t , murtest .Modify (mur , murtest .Finalizer ("finalizer.toolchain.dev.openshift.com" )))
212212 memberClient := commontest .NewFakeClient (t )
213213 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space )
214- InitializeCounters (t , NewToolchainStatus (
214+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
215215 WithMember (commontest .MemberClusterName ),
216216 WithMetric (toolchainv1alpha1 .UserSignupsPerActivationAndDomainMetricKey , toolchainv1alpha1.Metric {
217217 "1,internal" : 1 ,
@@ -280,7 +280,7 @@ func TestUserAccountSynchronizeSuccessfulWhenPropagatedClaimsModified(t *testing
280280 memberClient := commontest .NewFakeClient (t )
281281 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space , signup , toolchainStatus )
282282
283- InitializeCounters (t , toolchainStatus )
283+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
284284
285285 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ))
286286
@@ -346,7 +346,7 @@ func TestCreateUserAccountWhenItWasPreviouslyDeleted(t *testing.T) {
346346 require .NoError (t , murtest .Modify (mur , murtest .Finalizer ("finalizer.toolchain.dev.openshift.com" )))
347347 memberClient := commontest .NewFakeClient (t )
348348 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space )
349- InitializeCounters (t , NewToolchainStatus (
349+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
350350 WithMember (commontest .MemberClusterName ),
351351 WithMetric (toolchainv1alpha1 .UserSignupsPerActivationAndDomainMetricKey , toolchainv1alpha1.Metric {
352352 "1,internal" : 1 ,
@@ -417,7 +417,7 @@ func TestWithMultipleMembersAndSpaces(t *testing.T) {
417417 memberClient := commontest .NewFakeClient (t , newUserAccount (namespacedName (commontest .MemberOperatorNs , mur .Name ), mur ))
418418 memberClient2 := commontest .NewFakeClient (t )
419419 hostClient := commontest .NewFakeClient (t , mur , signup , spaceBinding , space , sharedSpaceBinding , sharedSpace , toolchainStatus )
420- InitializeCounters (t , toolchainStatus )
420+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
421421
422422 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ), ClusterClient (commontest .Member2ClusterName , memberClient2 ))
423423
@@ -459,7 +459,7 @@ func TestWithMultipleMembersAndSpaces(t *testing.T) {
459459 spacetest .WithSpecTargetCluster (commontest .Member2ClusterName ))
460460
461461 hostClient := commontest .NewFakeClient (t , murToMove , signup , spaceBinding , spaceInM2 , sharedSpaceBinding , sharedSpace , toolchainStatus )
462- InitializeCounters (t , toolchainStatus )
462+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
463463
464464 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ), ClusterClient (commontest .Member2ClusterName , memberClient2 ))
465465
@@ -533,7 +533,7 @@ func TestWithMultipleMembersAndSpaces(t *testing.T) {
533533 spacetest .WithFinalizer ()(terminatingSpace )
534534
535535 hostClient := commontest .NewFakeClient (t , mur , signup , userTier , spaceBinding , terminatingSpace , sharedSpaceBinding , sharedSpace , toolchainStatus )
536- InitializeCounters (t , toolchainStatus )
536+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
537537
538538 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ), ClusterClient (commontest .Member2ClusterName , memberClient2 ))
539539
@@ -567,7 +567,7 @@ func TestWithMultipleMembersAndSpaces(t *testing.T) {
567567 spacebindingtest .WithFinalizer ()(terminatingSpaceBinding )
568568
569569 hostClient := commontest .NewFakeClient (t , mur , signup , userTier , terminatingSpaceBinding , space , sharedSpaceBinding , sharedSpace , toolchainStatus )
570- InitializeCounters (t , toolchainStatus )
570+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
571571
572572 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ), ClusterClient (commontest .Member2ClusterName , memberClient2 ))
573573
@@ -599,7 +599,7 @@ func TestWithMultipleMembersAndSpaces(t *testing.T) {
599599
600600 otherSpaceBinding := spacebindingtest .NewSpaceBinding ("other-john" , "john-space" , "admin" , "john-123" )
601601 hostClient := commontest .NewFakeClient (t , mur , signup , userTier , otherSpaceBinding , space , sharedSpaceBinding , sharedSpace , toolchainStatus )
602- InitializeCounters (t , toolchainStatus )
602+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
603603
604604 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ), ClusterClient (commontest .Member2ClusterName , memberClient2 ))
605605
@@ -649,7 +649,7 @@ func TestRequeueWhenUserAccountDeleted(t *testing.T) {
649649
650650 t .Run ("when userAccount is accidentally being deleted then don't change the counter" , func (t * testing.T ) {
651651 // given
652- InitializeCounters (t , toolchainStatus )
652+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
653653 userAccount2 := uatest .NewUserAccountFromMur (mur ,
654654 uatest .DeletedUa (),
655655 uatest .WithFinalizer ())
@@ -688,7 +688,7 @@ func TestCreateSynchronizeOrDeleteUserAccountFailed(t *testing.T) {
688688 t .Run ("when member cluster does not exist and UA hasn't been created yet" , func (t * testing.T ) {
689689 // given
690690 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space )
691- InitializeCounters (t , NewToolchainStatus (
691+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
692692 WithMember (commontest .MemberClusterName ),
693693 WithMetric (toolchainv1alpha1 .UserSignupsPerActivationAndDomainMetricKey , toolchainv1alpha1.Metric {
694694 "1,internal" : 1 ,
@@ -725,7 +725,7 @@ func TestCreateSynchronizeOrDeleteUserAccountFailed(t *testing.T) {
725725 t .Run ("when member cluster does not exist and UA was already created" , func (t * testing.T ) {
726726 // given
727727 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space )
728- InitializeCounters (t , NewToolchainStatus (
728+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
729729 WithMember (commontest .MemberClusterName ),
730730 WithMetric (toolchainv1alpha1 .UserSignupsPerActivationAndDomainMetricKey , toolchainv1alpha1.Metric {
731731 "1,internal" : 1 ,
@@ -759,7 +759,7 @@ func TestCreateSynchronizeOrDeleteUserAccountFailed(t *testing.T) {
759759 t .Run ("status update of the MasterUserRecord failed" , func (t * testing.T ) {
760760 // given
761761 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space )
762- InitializeCounters (t , NewToolchainStatus (
762+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
763763 WithMember (commontest .MemberClusterName ),
764764 WithMetric (toolchainv1alpha1 .UserSignupsPerActivationAndDomainMetricKey , toolchainv1alpha1.Metric {
765765 "1,internal" : 1 ,
@@ -794,7 +794,7 @@ func TestCreateSynchronizeOrDeleteUserAccountFailed(t *testing.T) {
794794 t .Run ("creation of the UserAccount failed" , func (t * testing.T ) {
795795 // given
796796 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space )
797- InitializeCounters (t , NewToolchainStatus (
797+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
798798 WithMember (commontest .MemberClusterName ),
799799 WithMetric (toolchainv1alpha1 .UserSignupsPerActivationAndDomainMetricKey , toolchainv1alpha1.Metric {
800800 "1,internal" : 1 ,
@@ -831,7 +831,7 @@ func TestCreateSynchronizeOrDeleteUserAccountFailed(t *testing.T) {
831831
832832 t .Run ("spec synchronization of the UserAccount failed" , func (t * testing.T ) {
833833 // given
834- InitializeCounters (t , NewToolchainStatus (
834+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
835835 WithMember (commontest .MemberClusterName ),
836836 WithMetric (toolchainv1alpha1 .UserSignupsPerActivationAndDomainMetricKey , toolchainv1alpha1.Metric {
837837 "1,internal" : 1 ,
@@ -897,7 +897,7 @@ func TestCreateSynchronizeOrDeleteUserAccountFailed(t *testing.T) {
897897 memberClient := commontest .NewFakeClient (t , uatest .NewUserAccountFromMur (provisionedMur ,
898898 uatest .StatusCondition (toBeNotReady ("somethingFailed" , "" ))))
899899 hostClient := commontest .NewFakeClient (t , provisionedMur , toolchainStatus , spaceBinding , space )
900- InitializeCounters (t , toolchainStatus )
900+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
901901
902902 hostClient .MockStatusUpdate = func (ctx context.Context , obj runtimeclient.Object , opts ... runtimeclient.SubResourceUpdateOption ) error {
903903 hostClient .MockStatusUpdate = nil // mock only once
@@ -930,7 +930,7 @@ func TestCreateSynchronizeOrDeleteUserAccountFailed(t *testing.T) {
930930
931931 t .Run ("deletion of the UserAccount failed" , func (t * testing.T ) {
932932 // given
933- InitializeCounters (t , NewToolchainStatus (
933+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
934934 WithMember (commontest .MemberClusterName ),
935935 WithMetric (toolchainv1alpha1 .UserSignupsPerActivationAndDomainMetricKey , toolchainv1alpha1.Metric {
936936 "1,internal" : 1 ,
@@ -1009,7 +1009,7 @@ func TestModifyUserAccount(t *testing.T) {
10091009 memberClient3 := commontest .NewFakeClient (t )
10101010 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space , toolchainStatus )
10111011
1012- InitializeCounters (t , toolchainStatus )
1012+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
10131013
10141014 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ), ClusterClient (commontest .Member2ClusterName , memberClient2 ),
10151015 ClusterClient ("member3-cluster" , memberClient3 ))
@@ -1073,7 +1073,7 @@ func TestSyncMurStatusWithUserAccountStatuses(t *testing.T) {
10731073 string (metrics .Internal ): 1 ,
10741074 }))
10751075 hostClient := commontest .NewFakeClient (t , mur , toolchainStatus , spaceBinding , space )
1076- InitializeCounters (t , toolchainStatus )
1076+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
10771077
10781078 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ), ClusterClient (commontest .Member2ClusterName , memberClient2 ))
10791079
@@ -1138,7 +1138,7 @@ func TestSyncMurStatusWithUserAccountStatuses(t *testing.T) {
11381138 string (metrics .Internal ): 1 ,
11391139 }))
11401140 hostClient := commontest .NewFakeClient (t , userSignup , userTier , mur , spaceBinding , space , toolchainStatus )
1141- InitializeCounters (t , toolchainStatus )
1141+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
11421142
11431143 memberClient := commontest .NewFakeClient (t , userAccount )
11441144 memberClient2 := commontest .NewFakeClient (t )
@@ -1204,7 +1204,7 @@ func TestDeleteUserAccountViaMasterUserRecordBeingDeleted(t *testing.T) {
12041204
12051205 memberClient := commontest .NewFakeClient (t , userAcc )
12061206 hostClient := commontest .NewFakeClient (t , mur )
1207- InitializeCounters (t , toolchainStatus )
1207+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
12081208
12091209 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ))
12101210
@@ -1244,7 +1244,7 @@ func TestDeleteUserAccountViaMasterUserRecordBeingDeleted(t *testing.T) {
12441244
12451245 hostClient := commontest .NewFakeClient (t , mur , toolchainStatus )
12461246 memberClient := commontest .NewFakeClient (t , userAcc )
1247- InitializeCounters (t , toolchainStatus )
1247+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
12481248
12491249 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ))
12501250
@@ -1299,7 +1299,7 @@ func TestDeleteUserAccountViaMasterUserRecordBeingDeleted(t *testing.T) {
12991299
13001300 hostClient := commontest .NewFakeClient (t , mur , toolchainStatus )
13011301 memberClient := commontest .NewFakeClient (t , userAcc )
1302- InitializeCounters (t , toolchainStatus )
1302+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
13031303
13041304 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ))
13051305
@@ -1360,7 +1360,7 @@ func TestDeleteMultipleUserAccountsViaMasterUserRecordBeingDeleted(t *testing.T)
13601360 memberClient := commontest .NewFakeClient (t , userAcc )
13611361 memberClient2 := commontest .NewFakeClient (t , userAcc )
13621362 hostClient := commontest .NewFakeClient (t , mur )
1363- InitializeCounters (t , NewToolchainStatus (
1363+ InitializeCountersWithMetricsSyncDisabled (t , NewToolchainStatus (
13641364 WithMember (commontest .MemberClusterName ),
13651365 WithMember (commontest .Member2ClusterName ),
13661366 WithMember ("member3-cluster" ),
@@ -1427,7 +1427,7 @@ func TestDisablingMasterUserRecord(t *testing.T) {
14271427 string (metrics .Internal ): 1 ,
14281428 }))
14291429 hostClient := commontest .NewFakeClient (t , mur , spaceBinding , space , toolchainStatus )
1430- InitializeCounters (t , toolchainStatus )
1430+ InitializeCountersWithMetricsSyncDisabled (t , toolchainStatus )
14311431
14321432 cntrl := newController (hostClient , s , ClusterClient (commontest .MemberClusterName , memberClient ))
14331433
0 commit comments