@@ -17,6 +17,7 @@ limitations under the License.
17
17
package scale
18
18
19
19
import (
20
+ "context"
20
21
"encoding/json"
21
22
"fmt"
22
23
"testing"
@@ -69,7 +70,7 @@ func TestReplicationControllerScaleRetry(t *testing.T) {
69
70
namespace := metav1 .NamespaceDefault
70
71
71
72
scaleFunc := ScaleCondition (scaler , nil , namespace , name , count , nil , rcgvr , false )
72
- pass , err := scaleFunc ()
73
+ pass , err := scaleFunc (context . Background () )
73
74
if pass {
74
75
t .Errorf ("Expected an update failure to return pass = false, got pass = %v" , pass )
75
76
}
@@ -78,7 +79,7 @@ func TestReplicationControllerScaleRetry(t *testing.T) {
78
79
}
79
80
preconditions := ScalePrecondition {3 , "" }
80
81
scaleFunc = ScaleCondition (scaler , & preconditions , namespace , name , count , nil , rcgvr , false )
81
- _ , err = scaleFunc ()
82
+ _ , err = scaleFunc (context . Background () )
82
83
if err == nil {
83
84
t .Errorf ("Expected error on precondition failure" )
84
85
}
@@ -105,7 +106,7 @@ func TestReplicationControllerScaleInvalid(t *testing.T) {
105
106
namespace := "default"
106
107
107
108
scaleFunc := ScaleCondition (scaler , nil , namespace , name , count , nil , rcgvr , false )
108
- pass , err := scaleFunc ()
109
+ pass , err := scaleFunc (context . Background () )
109
110
if pass {
110
111
t .Errorf ("Expected an update failure to return pass = false, got pass = %v" , pass )
111
112
}
@@ -179,7 +180,7 @@ func TestDeploymentScaleRetry(t *testing.T) {
179
180
namespace := "default"
180
181
181
182
scaleFunc := ScaleCondition (scaler , nil , namespace , name , count , nil , deploygvr , false )
182
- pass , err := scaleFunc ()
183
+ pass , err := scaleFunc (context . Background () )
183
184
if pass != false {
184
185
t .Errorf ("Expected an update failure to return pass = false, got pass = %v" , pass )
185
186
}
@@ -188,7 +189,7 @@ func TestDeploymentScaleRetry(t *testing.T) {
188
189
}
189
190
preconditions := & ScalePrecondition {3 , "" }
190
191
scaleFunc = ScaleCondition (scaler , preconditions , namespace , name , count , nil , deploygvr , false )
191
- _ , err = scaleFunc ()
192
+ _ , err = scaleFunc (context . Background () )
192
193
if err == nil {
193
194
t .Error ("Expected error on precondition failure" )
194
195
}
@@ -236,7 +237,7 @@ func TestDeploymentScaleInvalid(t *testing.T) {
236
237
namespace := "default"
237
238
238
239
scaleFunc := ScaleCondition (scaler , nil , namespace , name , count , nil , deploygvr , false )
239
- pass , err := scaleFunc ()
240
+ pass , err := scaleFunc (context . Background () )
240
241
if pass {
241
242
t .Errorf ("Expected an update failure to return pass = false, got pass = %v" , pass )
242
243
}
@@ -309,7 +310,7 @@ func TestStatefulSetScaleRetry(t *testing.T) {
309
310
namespace := "default"
310
311
311
312
scaleFunc := ScaleCondition (scaler , nil , namespace , name , count , nil , stsgvr , false )
312
- pass , err := scaleFunc ()
313
+ pass , err := scaleFunc (context . Background () )
313
314
if pass != false {
314
315
t .Errorf ("Expected an update failure to return pass = false, got pass = %v" , pass )
315
316
}
@@ -318,7 +319,7 @@ func TestStatefulSetScaleRetry(t *testing.T) {
318
319
}
319
320
preconditions := & ScalePrecondition {3 , "" }
320
321
scaleFunc = ScaleCondition (scaler , preconditions , namespace , name , count , nil , stsgvr , false )
321
- _ , err = scaleFunc ()
322
+ _ , err = scaleFunc (context . Background () )
322
323
if err == nil {
323
324
t .Error ("Expected error on precondition failure" )
324
325
}
@@ -345,7 +346,7 @@ func TestStatefulSetScaleInvalid(t *testing.T) {
345
346
namespace := "default"
346
347
347
348
scaleFunc := ScaleCondition (scaler , nil , namespace , name , count , nil , stsgvr , false )
348
- pass , err := scaleFunc ()
349
+ pass , err := scaleFunc (context . Background () )
349
350
if pass {
350
351
t .Errorf ("Expected an update failure to return pass = false, got pass = %v" , pass )
351
352
}
@@ -418,7 +419,7 @@ func TestReplicaSetScaleRetry(t *testing.T) {
418
419
namespace := "default"
419
420
420
421
scaleFunc := ScaleCondition (scaler , nil , namespace , name , count , nil , rsgvr , false )
421
- pass , err := scaleFunc ()
422
+ pass , err := scaleFunc (context . Background () )
422
423
if pass != false {
423
424
t .Errorf ("Expected an update failure to return pass = false, got pass = %v" , pass )
424
425
}
@@ -427,7 +428,7 @@ func TestReplicaSetScaleRetry(t *testing.T) {
427
428
}
428
429
preconditions := & ScalePrecondition {3 , "" }
429
430
scaleFunc = ScaleCondition (scaler , preconditions , namespace , name , count , nil , rsgvr , false )
430
- _ , err = scaleFunc ()
431
+ _ , err = scaleFunc (context . Background () )
431
432
if err == nil {
432
433
t .Error ("Expected error on precondition failure" )
433
434
}
@@ -454,7 +455,7 @@ func TestReplicaSetScaleInvalid(t *testing.T) {
454
455
namespace := "default"
455
456
456
457
scaleFunc := ScaleCondition (scaler , nil , namespace , name , count , nil , rsgvr , false )
457
- pass , err := scaleFunc ()
458
+ pass , err := scaleFunc (context . Background () )
458
459
if pass {
459
460
t .Errorf ("Expected an update failure to return pass = false, got pass = %v" , pass )
460
461
}
0 commit comments