@@ -286,7 +286,7 @@ func regularJobObjectAppliedActual(nsName, jobName string, appliedWorkOwnerRef *
286286 return func () error {
287287 // Retrieve the Job object.
288288 gotJob := & batchv1.Job {}
289- if err := memberClient .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, gotJob ); err != nil {
289+ if err := memberClient1 .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, gotJob ); err != nil {
290290 return fmt .Errorf ("failed to retrieve the Job object: %w" , err )
291291 }
292292
@@ -693,7 +693,7 @@ func regularJobNotRemovedActual(nsName, jobName string) func() error {
693693 Name : jobName ,
694694 },
695695 }
696- if err := memberClient .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, job ); err != nil {
696+ if err := memberClient1 .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, job ); err != nil {
697697 return fmt .Errorf ("failed to retrieve the Job object: %w" , err )
698698 }
699699 return nil
@@ -3783,7 +3783,7 @@ var _ = Describe("drift detection and takeover", func() {
37833783 WhenToApply : fleetv1beta1 .WhenToApplyTypeIfNotDrifted ,
37843784 WhenToTakeOver : fleetv1beta1 .WhenToTakeOverTypeAlways ,
37853785 }
3786- createWorkObject (workName , applyStrategy , regularNSJSON , regularJobJSON )
3786+ createWorkObject (workName , memberReservedNSName1 , applyStrategy , regularNSJSON , regularJobJSON )
37873787 })
37883788
37893789 It ("should add cleanup finalizer to the Work object" , func () {
@@ -3873,13 +3873,13 @@ var _ = Describe("drift detection and takeover", func() {
38733873 regularNSObjectAppliedActual := regularNSObjectAppliedActual (nsName , appliedWorkOwnerRef )
38743874 Eventually (regularNSObjectAppliedActual , eventuallyDuration , eventuallyInterval ).Should (Succeed (), "Failed to apply the namespace object" )
38753875
3876- Expect (memberClient .Get (ctx , client.ObjectKey {Name : nsName }, regularNS )).To (Succeed (), "Failed to retrieve the NS object" )
3876+ Expect (memberClient1 .Get (ctx , client.ObjectKey {Name : nsName }, regularNS )).To (Succeed (), "Failed to retrieve the NS object" )
38773877
38783878 // Ensure that the Job object has been applied as expected.
38793879 regularJobObjectAppliedActual := regularJobObjectAppliedActual (nsName , jobName , appliedWorkOwnerRef )
38803880 Eventually (regularJobObjectAppliedActual , eventuallyDuration , eventuallyInterval ).Should (Succeed (), "Failed to apply the job object" )
38813881
3882- Expect (memberClient .Get (ctx , client.ObjectKey {Name : jobName , Namespace : nsName }, regularJob )).To (Succeed (), "Failed to retrieve the Job object" )
3882+ Expect (memberClient1 .Get (ctx , client.ObjectKey {Name : jobName , Namespace : nsName }, regularJob )).To (Succeed (), "Failed to retrieve the Job object" )
38833883 })
38843884
38853885 It ("should update the AppliedWork object status" , func () {
@@ -3918,18 +3918,18 @@ var _ = Describe("drift detection and takeover", func() {
39183918 // Update the labels in the pod template.
39193919 //
39203920 // This is only possible when the Job is just created in the suspended state.
3921- Expect (memberClient .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, regularJob )).To (Succeed (), "Failed to retrieve the Job object" )
3921+ Expect (memberClient1 .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, regularJob )).To (Succeed (), "Failed to retrieve the Job object" )
39223922
39233923 // Use an Eventually block to guard transient errors.
39243924 Eventually (func () error {
39253925 regularJob .Spec .Template .Labels [dummyLabelKey ] = dummyLabelValue2
3926- return memberClient .Update (ctx , regularJob )
3926+ return memberClient1 .Update (ctx , regularJob )
39273927 }, eventuallyDuration , eventuallyInterval ).Should (Succeed (), "Failed to update the Job object" )
39283928
39293929 // Unsuspend the Job object. This would make the pod template immutable.
39303930 Eventually (func () error {
39313931 regularJob .Spec .Suspend = ptr .To (false )
3932- return memberClient .Update (ctx , regularJob )
3932+ return memberClient1 .Update (ctx , regularJob )
39333933 }, eventuallyDuration , eventuallyInterval ).Should (Succeed (), "Failed to unsuspend the Job object" )
39343934 })
39353935
@@ -4004,7 +4004,7 @@ var _ = Describe("drift detection and takeover", func() {
40044004 Eventually (func () error {
40054005 // Retrieve the Work object.
40064006 work := & fleetv1beta1.Work {}
4007- if err := hubClient .Get (ctx , client.ObjectKey {Name : workName , Namespace : memberReservedNSName }, work ); err != nil {
4007+ if err := hubClient .Get (ctx , client.ObjectKey {Name : workName , Namespace : memberReservedNSName1 }, work ); err != nil {
40084008 return fmt .Errorf ("failed to retrieve the Work object: %w" , err )
40094009 }
40104010
@@ -4048,7 +4048,7 @@ var _ = Describe("drift detection and takeover", func() {
40484048 Consistently (func () error {
40494049 // Retrieve the Job object.
40504050 gotJob := & batchv1.Job {}
4051- if err := memberClient .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, gotJob ); err != nil {
4051+ if err := memberClient1 .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, gotJob ); err != nil {
40524052 return fmt .Errorf ("failed to retrieve the Job object: %w" , err )
40534053 }
40544054
@@ -4101,7 +4101,7 @@ var _ = Describe("drift detection and takeover", func() {
41014101 return nil
41024102 }, consistentlyDuration , consistentlyInterval ).Should (Succeed (), "Failed to leave the Job object alone" )
41034103
4104- Expect (memberClient .Get (ctx , client.ObjectKey {Name : jobName , Namespace : nsName }, regularJob )).To (Succeed (), "Failed to retrieve the Job object" )
4104+ Expect (memberClient1 .Get (ctx , client.ObjectKey {Name : jobName , Namespace : nsName }, regularJob )).To (Succeed (), "Failed to retrieve the Job object" )
41054105 })
41064106
41074107 It ("should update the AppliedWork object status" , func () {
@@ -4126,7 +4126,7 @@ var _ = Describe("drift detection and takeover", func() {
41264126
41274127 AfterAll (func () {
41284128 // Delete the Work object and related resources.
4129- deleteWorkObject (workName )
4129+ deleteWorkObject (workName , memberReservedNSName1 )
41304130
41314131 // Ensure that the Job object has been left alone.
41324132 jobNotRemovedActual := regularJobNotRemovedActual (nsName , jobName )
@@ -6272,8 +6272,8 @@ var _ = Describe("report diff", func() {
62726272 regularJob .Name = jobName
62736273
62746274 // Create the objects first in the member cluster.
6275- Expect (memberClient .Create (ctx , regularNS )).To (Succeed (), "Failed to create the NS object" )
6276- Expect (memberClient .Create (ctx , regularJob )).To (Succeed (), "Failed to create the Job object" )
6275+ Expect (memberClient1 .Create (ctx , regularNS )).To (Succeed (), "Failed to create the NS object" )
6276+ Expect (memberClient1 .Create (ctx , regularJob )).To (Succeed (), "Failed to create the Job object" )
62776277
62786278 // Update the values on the hub cluster side so that diffs will be found.
62796279 updatedJob := job .DeepCopy ()
@@ -6291,7 +6291,7 @@ var _ = Describe("report diff", func() {
62916291 Type : fleetv1beta1 .ApplyStrategyTypeReportDiff ,
62926292 WhenToTakeOver : fleetv1beta1 .WhenToTakeOverTypeNever ,
62936293 }
6294- createWorkObject (workName , applyStrategy , regularNSJSON , updatedJSONJSON )
6294+ createWorkObject (workName , memberReservedNSName1 , applyStrategy , regularNSJSON , updatedJSONJSON )
62956295 })
62966296
62976297 It ("should add cleanup finalizer to the Work object" , func () {
@@ -6376,7 +6376,7 @@ var _ = Describe("report diff", func() {
63766376 Eventually (func () error {
63776377 // Retrieve the Work object.
63786378 work := & fleetv1beta1.Work {}
6379- if err := hubClient .Get (ctx , client.ObjectKey {Name : workName , Namespace : memberReservedNSName }, work ); err != nil {
6379+ if err := hubClient .Get (ctx , client.ObjectKey {Name : workName , Namespace : memberReservedNSName1 }, work ); err != nil {
63806380 return fmt .Errorf ("failed to retrieve the Work object: %w" , err )
63816381 }
63826382
@@ -6416,7 +6416,7 @@ var _ = Describe("report diff", func() {
64166416 Consistently (func () error {
64176417 // Retrieve the NS object.
64186418 updatedNS := & corev1.Namespace {}
6419- if err := memberClient .Get (ctx , client.ObjectKey {Name : nsName }, updatedNS ); err != nil {
6419+ if err := memberClient1 .Get (ctx , client.ObjectKey {Name : nsName }, updatedNS ); err != nil {
64206420 return fmt .Errorf ("failed to retrieve the NS object: %w" , err )
64216421 }
64226422
@@ -6439,7 +6439,7 @@ var _ = Describe("report diff", func() {
64396439 Consistently (func () error {
64406440 // Retrieve the Job object.
64416441 updatedJob := & batchv1.Job {}
6442- if err := memberClient .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, updatedJob ); err != nil {
6442+ if err := memberClient1 .Get (ctx , client.ObjectKey {Namespace : nsName , Name : jobName }, updatedJob ); err != nil {
64436443 return fmt .Errorf ("failed to retrieve the Job object: %w" , err )
64446444 }
64456445
@@ -6498,7 +6498,7 @@ var _ = Describe("report diff", func() {
64986498
64996499 AfterAll (func () {
65006500 // Delete the Work object and related resources.
6501- deleteWorkObject (workName )
6501+ deleteWorkObject (workName , memberReservedNSName1 )
65026502
65036503 // Ensure that the Job object has been left alone.
65046504 jobNotRemovedActual := regularJobNotRemovedActual (nsName , jobName )
0 commit comments