@@ -547,7 +547,7 @@ func TestMetadataClient(t *testing.T) {
547
547
})
548
548
549
549
client := metadata .NewForConfigOrDie (cfg ).Resource (v1 .SchemeGroupVersion .WithResource ("services" ))
550
- items , err := client .Namespace (ns ).List (metav1.ListOptions {})
550
+ items , err := client .Namespace (ns ).List (context . TODO (), metav1.ListOptions {})
551
551
if err != nil {
552
552
t .Fatal (err )
553
553
}
@@ -566,7 +566,7 @@ func TestMetadataClient(t *testing.T) {
566
566
}
567
567
wrapper .resp = nil
568
568
569
- item , err := client .Namespace (ns ).Get ("test-1" , metav1.GetOptions {})
569
+ item , err := client .Namespace (ns ).Get (context . TODO (), "test-1" , metav1.GetOptions {})
570
570
if err != nil {
571
571
t .Fatal (err )
572
572
}
@@ -577,19 +577,19 @@ func TestMetadataClient(t *testing.T) {
577
577
t .Fatalf ("unexpected response: %#v" , wrapper .resp )
578
578
}
579
579
580
- item , err = client .Namespace (ns ).Patch ("test-1" , types .MergePatchType , []byte (`{"metadata":{"annotations":{"foo":"baz"}}}` ), metav1.PatchOptions {})
580
+ item , err = client .Namespace (ns ).Patch (context . TODO (), "test-1" , types .MergePatchType , []byte (`{"metadata":{"annotations":{"foo":"baz"}}}` ), metav1.PatchOptions {})
581
581
if err != nil {
582
582
t .Fatal (err )
583
583
}
584
584
if item .Annotations ["foo" ] != "baz" {
585
585
t .Fatalf ("unexpected object: %#v" , item )
586
586
}
587
587
588
- if err := client .Namespace (ns ).Delete ("test-1" , & metav1.DeleteOptions {Preconditions : & metav1.Preconditions {UID : & item .UID }}); err != nil {
588
+ if err := client .Namespace (ns ).Delete (context . TODO (), "test-1" , metav1.DeleteOptions {Preconditions : & metav1.Preconditions {UID : & item .UID }}); err != nil {
589
589
t .Fatal (err )
590
590
}
591
591
592
- if _ , err := client .Namespace (ns ).Get ("test-1" , metav1.GetOptions {}); ! apierrors .IsNotFound (err ) {
592
+ if _ , err := client .Namespace (ns ).Get (context . TODO (), "test-1" , metav1.GetOptions {}); ! apierrors .IsNotFound (err ) {
593
593
t .Fatal (err )
594
594
}
595
595
},
@@ -624,7 +624,7 @@ func TestMetadataClient(t *testing.T) {
624
624
})
625
625
626
626
client := metadata .NewForConfigOrDie (cfg ).Resource (crdGVR )
627
- items , err := client .Namespace (ns ).List (metav1.ListOptions {})
627
+ items , err := client .Namespace (ns ).List (context . TODO (), metav1.ListOptions {})
628
628
if err != nil {
629
629
t .Fatal (err )
630
630
}
@@ -643,7 +643,7 @@ func TestMetadataClient(t *testing.T) {
643
643
}
644
644
wrapper .resp = nil
645
645
646
- item , err := client .Namespace (ns ).Get ("test-1" , metav1.GetOptions {})
646
+ item , err := client .Namespace (ns ).Get (context . TODO (), "test-1" , metav1.GetOptions {})
647
647
if err != nil {
648
648
t .Fatal (err )
649
649
}
@@ -654,18 +654,18 @@ func TestMetadataClient(t *testing.T) {
654
654
t .Fatalf ("unexpected response: %#v" , wrapper .resp )
655
655
}
656
656
657
- item , err = client .Namespace (ns ).Patch ("test-1" , types .MergePatchType , []byte (`{"metadata":{"annotations":{"foo":"baz"}}}` ), metav1.PatchOptions {})
657
+ item , err = client .Namespace (ns ).Patch (context . TODO (), "test-1" , types .MergePatchType , []byte (`{"metadata":{"annotations":{"foo":"baz"}}}` ), metav1.PatchOptions {})
658
658
if err != nil {
659
659
t .Fatal (err )
660
660
}
661
661
if item .Annotations ["foo" ] != "baz" {
662
662
t .Fatalf ("unexpected object: %#v" , item )
663
663
}
664
664
665
- if err := client .Namespace (ns ).Delete ("test-1" , & metav1.DeleteOptions {Preconditions : & metav1.Preconditions {UID : & item .UID }}); err != nil {
665
+ if err := client .Namespace (ns ).Delete (context . TODO (), "test-1" , metav1.DeleteOptions {Preconditions : & metav1.Preconditions {UID : & item .UID }}); err != nil {
666
666
t .Fatal (err )
667
667
}
668
- if _ , err := client .Namespace (ns ).Get ("test-1" , metav1.GetOptions {}); ! apierrors .IsNotFound (err ) {
668
+ if _ , err := client .Namespace (ns ).Get (context . TODO (), "test-1" , metav1.GetOptions {}); ! apierrors .IsNotFound (err ) {
669
669
t .Fatal (err )
670
670
}
671
671
},
@@ -690,7 +690,7 @@ func TestMetadataClient(t *testing.T) {
690
690
})
691
691
692
692
client := metadata .NewForConfigOrDie (cfg ).Resource (v1 .SchemeGroupVersion .WithResource ("services" ))
693
- w , err := client .Namespace (ns ).Watch (metav1.ListOptions {ResourceVersion : svc .ResourceVersion , Watch : true })
693
+ w , err := client .Namespace (ns ).Watch (context . TODO (), metav1.ListOptions {ResourceVersion : svc .ResourceVersion , Watch : true })
694
694
if err != nil {
695
695
t .Fatal (err )
696
696
}
@@ -747,7 +747,7 @@ func TestMetadataClient(t *testing.T) {
747
747
cfg := metadata .ConfigFor (config )
748
748
client := metadata .NewForConfigOrDie (cfg ).Resource (crdGVR )
749
749
750
- patched , err := client .Namespace (ns ).Patch ("test-2" , types .MergePatchType , []byte (`{"metadata":{"annotations":{"test":"1"}}}` ), metav1.PatchOptions {})
750
+ patched , err := client .Namespace (ns ).Patch (context . TODO (), "test-2" , types .MergePatchType , []byte (`{"metadata":{"annotations":{"test":"1"}}}` ), metav1.PatchOptions {})
751
751
if err != nil {
752
752
t .Fatal (err )
753
753
}
@@ -762,7 +762,7 @@ func TestMetadataClient(t *testing.T) {
762
762
})
763
763
client = metadata .NewForConfigOrDie (cfg ).Resource (crdGVR )
764
764
765
- w , err := client .Namespace (ns ).Watch (metav1.ListOptions {ResourceVersion : cr .GetResourceVersion (), Watch : true })
765
+ w , err := client .Namespace (ns ).Watch (context . TODO (), metav1.ListOptions {ResourceVersion : cr .GetResourceVersion (), Watch : true })
766
766
if err != nil {
767
767
t .Fatal (err )
768
768
}
0 commit comments