Skip to content

Commit 719d24e

Browse files
committed
context consistency: ensure all context are TODO()
1 parent d7a617d commit 719d24e

8 files changed

Lines changed: 462 additions & 9 deletions

File tree

pkg/controller/istiocsr/certificates_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func TestCreateOrApplyCertificates(t *testing.T) {
217217
}
218218
r.ctrlClient = mock
219219
istiocsr := &v1alpha1.IstioCSR{}
220-
if err := r.Get(context.Background(), types.NamespacedName{
220+
if err := r.Get(context.TODO(), types.NamespacedName{
221221
Namespace: testIstioCSR().Namespace,
222222
Name: testIstioCSR().Name,
223223
}, istiocsr); err != nil {

pkg/controller/istiocsr/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func New(mgr ctrl.Manager) (*Reconciler, error) {
114114
}
115115
return &Reconciler{
116116
ctrlClient: c,
117-
ctx: context.Background(),
117+
ctx: context.TODO(),
118118
eventRecorder: mgr.GetEventRecorderFor(ControllerName),
119119
log: ctrl.Log.WithName(ControllerName),
120120
scheme: mgr.GetScheme(),

pkg/controller/istiocsr/controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ func TestReconcile(t *testing.T) {
417417
}
418418
r.ctrlClient = mock
419419
istiocsr := testIstioCSR()
420-
result, err := r.Reconcile(context.Background(),
420+
result, err := r.Reconcile(context.TODO(),
421421
ctrl.Request{
422422
NamespacedName: types.NamespacedName{Name: istiocsr.GetName(), Namespace: istiocsr.GetNamespace()},
423423
},

pkg/controller/istiocsr/test_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type CertificateTweak func(*x509.Certificate)
4444

4545
func testReconciler(t *testing.T) *Reconciler {
4646
return &Reconciler{
47-
ctx: context.Background(),
47+
ctx: context.TODO(),
4848
eventRecorder: record.NewFakeRecorder(100),
4949
log: testr.New(t),
5050
scheme: testutil.Scheme,

pkg/operator/informers/externalversions/factory.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)