@@ -802,11 +802,11 @@ func TestController(t *testing.T) {
802
802
if test .addFinalizer {
803
803
provisionerOptions = append (provisionerOptions , AddFinalizer (true ))
804
804
}
805
- logger , _ := ktesting .NewTestContext (t )
805
+ _ , ctx := ktesting .NewTestContext (t )
806
806
if test .additionalProvisionerNames == nil {
807
- ctrl = newTestProvisionController (logger , client , test .provisionerName , test .provisioner , provisionerOptions ... )
807
+ ctrl = newTestProvisionController (ctx , client , test .provisionerName , test .provisioner , provisionerOptions ... )
808
808
} else {
809
- ctrl = newTestProvisionControllerWithAdditionalNames (logger , client , test .provisionerName , test .provisioner , test .additionalProvisionerNames , provisionerOptions ... )
809
+ ctrl = newTestProvisionControllerWithAdditionalNames (ctx , client , test .provisionerName , test .provisioner , test .additionalProvisionerNames , provisionerOptions ... )
810
810
}
811
811
for _ , claim := range test .claimsInProgress {
812
812
ctrl .claimsInProgress .Store (string (claim .UID ), claim )
@@ -957,10 +957,10 @@ func TestTopologyParams(t *testing.T) {
957
957
}
958
958
for _ , test := range tests {
959
959
t .Run (test .name , func (t * testing.T ) {
960
- logger , _ := ktesting .NewTestContext (t )
960
+ _ , ctx := ktesting .NewTestContext (t )
961
961
client := fake .NewSimpleClientset (test .objs ... )
962
962
provisioner := newTestProvisioner ()
963
- ctrl := newTestProvisionController (logger , client , "foo.bar/baz" /* provisionerName */ , provisioner )
963
+ ctrl := newTestProvisionController (ctx , client , "foo.bar/baz" /* provisionerName */ , provisioner )
964
964
// Run forever...
965
965
go ctrl .Run (context .Background ())
966
966
@@ -1114,12 +1114,12 @@ func TestShouldProvision(t *testing.T) {
1114
1114
t .Run (test .name , func (t * testing.T ) {
1115
1115
client := fake .NewSimpleClientset (test .claim )
1116
1116
1117
- logger , _ := ktesting .NewTestContext (t )
1117
+ _ , ctx := ktesting .NewTestContext (t )
1118
1118
var ctrl testProvisionController
1119
1119
if test .additionalProvisionerNames == nil {
1120
- ctrl = newTestProvisionController (logger , client , test .provisionerName , test .provisioner )
1120
+ ctrl = newTestProvisionController (ctx , client , test .provisionerName , test .provisioner )
1121
1121
} else {
1122
- ctrl = newTestProvisionControllerWithAdditionalNames (logger , client , test .provisionerName , test .provisioner , test .additionalProvisionerNames )
1122
+ ctrl = newTestProvisionControllerWithAdditionalNames (ctx , client , test .provisionerName , test .provisioner , test .additionalProvisionerNames )
1123
1123
}
1124
1124
1125
1125
if test .class != nil {
@@ -1195,10 +1195,10 @@ func TestShouldDelete(t *testing.T) {
1195
1195
}
1196
1196
for _ , test := range tests {
1197
1197
t .Run (test .name , func (t * testing.T ) {
1198
- logger , _ := ktesting .NewTestContext (t )
1198
+ _ , ctx := ktesting .NewTestContext (t )
1199
1199
client := fake .NewSimpleClientset ()
1200
1200
provisioner := newTestProvisioner ()
1201
- ctrl := newTestProvisionController (logger , client , test .provisionerName , provisioner )
1201
+ ctrl := newTestProvisionController (ctx , client , test .provisionerName , provisioner )
1202
1202
test .volume .ObjectMeta .DeletionTimestamp = test .deletionTimestamp
1203
1203
1204
1204
should := ctrl .shouldDelete (context .Background (), test .volume )
@@ -1285,10 +1285,10 @@ func TestIsProvisionerForVolume(t *testing.T) {
1285
1285
}
1286
1286
for _ , test := range tests {
1287
1287
t .Run (test .name , func (t * testing.T ) {
1288
- logger , _ := ktesting .NewTestContext (t )
1288
+ _ , ctx := ktesting .NewTestContext (t )
1289
1289
client := fake .NewSimpleClientset ()
1290
1290
provisioner := newTestProvisioner ()
1291
- ctrl := newTestProvisionController (logger , client , test .provisionerName , provisioner )
1291
+ ctrl := newTestProvisionController (ctx , client , test .provisionerName , provisioner )
1292
1292
should := ctrl .isProvisionerForVolume (context .Background (), test .volume )
1293
1293
if test .expectedShould != should {
1294
1294
t .Errorf ("expected should delete %v but got %v\n " , test .expectedShould , should )
@@ -1343,12 +1343,12 @@ func TestShouldDeleteWithFinalizer(t *testing.T) {
1343
1343
}
1344
1344
for _ , test := range tests {
1345
1345
t .Run (test .name , func (t * testing.T ) {
1346
- logger , _ := ktesting .NewTestContext (t )
1346
+ _ , ctx := ktesting .NewTestContext (t )
1347
1347
client := fake .NewSimpleClientset ()
1348
1348
provisioner := newTestProvisioner ()
1349
1349
provisionerOptions := make ([]func (* ProvisionController ) error , 0 )
1350
1350
provisionerOptions = append (provisionerOptions , AddFinalizer (true ))
1351
- ctrl := newTestProvisionController (logger , client , test .provisionerName , provisioner , provisionerOptions ... )
1351
+ ctrl := newTestProvisionController (ctx , client , test .provisionerName , provisioner , provisionerOptions ... )
1352
1352
test .volume .ObjectMeta .DeletionTimestamp = test .deletionTimestamp
1353
1353
1354
1354
should := ctrl .shouldDelete (context .Background (), test .volume )
@@ -1539,9 +1539,9 @@ func TestCanProvision(t *testing.T) {
1539
1539
}
1540
1540
for _ , test := range tests {
1541
1541
t .Run (test .name , func (t * testing.T ) {
1542
- logger , _ := ktesting .NewTestContext (t )
1542
+ _ , ctx := ktesting .NewTestContext (t )
1543
1543
client := fake .NewSimpleClientset (test .claim )
1544
- ctrl := newTestProvisionController (logger , client , provisionerName , test .provisioner )
1544
+ ctrl := newTestProvisionController (ctx , client , provisionerName , test .provisioner )
1545
1545
1546
1546
can := ctrl .canProvision (context .Background (), test .claim )
1547
1547
if ! reflect .DeepEqual (test .expectedCan , can ) {
@@ -1581,10 +1581,10 @@ func TestControllerSharedInformers(t *testing.T) {
1581
1581
1582
1582
for _ , test := range tests {
1583
1583
t .Run (test .name , func (t * testing.T ) {
1584
- logger , _ := ktesting .NewTestContext (t )
1584
+ _ , ctx := ktesting .NewTestContext (t )
1585
1585
client := fake .NewSimpleClientset (test .objs ... )
1586
1586
1587
- ctrl , informersFactory := newTestProvisionControllerSharedInformers (logger , client , test .provisionerName ,
1587
+ ctrl , informersFactory := newTestProvisionControllerSharedInformers (ctx , client , test .provisionerName ,
1588
1588
newTestProvisioner (), sharedResyncPeriod )
1589
1589
stopCh := make (chan struct {})
1590
1590
defer close (stopCh )
@@ -1665,7 +1665,7 @@ func getCounts(t *testing.T, vec *prometheus.CounterVec, cts *counts, success bo
1665
1665
}
1666
1666
1667
1667
func newTestProvisionController (
1668
- logger klog. Logger ,
1668
+ ctx context. Context ,
1669
1669
client kubernetes.Interface ,
1670
1670
provisionerName string ,
1671
1671
provisioner Provisioner ,
@@ -1684,7 +1684,7 @@ func newTestProvisionController(
1684
1684
provisionerOptions = append (provisionerOptions , options ... )
1685
1685
}
1686
1686
ctrl := NewProvisionController (
1687
- logger ,
1687
+ ctx ,
1688
1688
client ,
1689
1689
provisionerName ,
1690
1690
provisioner ,
@@ -1696,7 +1696,7 @@ func newTestProvisionController(
1696
1696
}
1697
1697
1698
1698
func newTestProvisionControllerWithAdditionalNames (
1699
- logger klog. Logger ,
1699
+ ctx context. Context ,
1700
1700
client kubernetes.Interface ,
1701
1701
provisionerName string ,
1702
1702
provisioner Provisioner ,
@@ -1717,7 +1717,7 @@ func newTestProvisionControllerWithAdditionalNames(
1717
1717
provisionerOptions = append (provisionerOptions , options ... )
1718
1718
}
1719
1719
ctrl := NewProvisionController (
1720
- logger ,
1720
+ ctx ,
1721
1721
client ,
1722
1722
provisionerName ,
1723
1723
provisioner ,
@@ -1729,7 +1729,7 @@ func newTestProvisionControllerWithAdditionalNames(
1729
1729
}
1730
1730
1731
1731
func newTestProvisionControllerSharedInformers (
1732
- klog klog. Logger ,
1732
+ ctx context. Context ,
1733
1733
client kubernetes.Interface ,
1734
1734
provisionerName string ,
1735
1735
provisioner Provisioner ,
@@ -1744,7 +1744,7 @@ func newTestProvisionControllerSharedInformers(
1744
1744
}()
1745
1745
1746
1746
ctrl := NewProvisionController (
1747
- klog ,
1747
+ ctx ,
1748
1748
client ,
1749
1749
provisionerName ,
1750
1750
provisioner ,
0 commit comments