Wire contexts to Apps controllers

This commit is contained in:
Mike Dame
2021-04-22 14:14:52 -04:00
parent 38746752af
commit 41fcb95f2f
36 changed files with 404 additions and 375 deletions

View File

@@ -438,7 +438,7 @@ func TestOneNodeDaemonLaunchesPod(t *testing.T) {
setupScheduler(ctx, t, clientset, informers)
informers.Start(ctx.Done())
go dc.Run(5, ctx.Done())
go dc.Run(ctx, 5)
ds := newDaemonSet("foo", ns.Name)
ds.Spec.UpdateStrategy = *strategy
@@ -474,7 +474,7 @@ func TestSimpleDaemonSetLaunchesPods(t *testing.T) {
defer cancel()
informers.Start(ctx.Done())
go dc.Run(5, ctx.Done())
go dc.Run(ctx, 5)
// Start Scheduler
setupScheduler(ctx, t, clientset, informers)
@@ -510,7 +510,7 @@ func TestDaemonSetWithNodeSelectorLaunchesPods(t *testing.T) {
defer cancel()
informers.Start(ctx.Done())
go dc.Run(5, ctx.Done())
go dc.Run(ctx, 5)
// Start Scheduler
setupScheduler(ctx, t, clientset, informers)
@@ -579,7 +579,7 @@ func TestNotReadyNodeDaemonDoesLaunchPod(t *testing.T) {
defer cancel()
informers.Start(ctx.Done())
go dc.Run(5, ctx.Done())
go dc.Run(ctx, 5)
// Start Scheduler
setupScheduler(ctx, t, clientset, informers)
@@ -626,7 +626,7 @@ func TestInsufficientCapacityNode(t *testing.T) {
defer cancel()
informers.Start(ctx.Done())
go dc.Run(5, ctx.Done())
go dc.Run(ctx, 5)
// Start Scheduler
setupScheduler(ctx, t, clientset, informers)
@@ -689,7 +689,7 @@ func TestLaunchWithHashCollision(t *testing.T) {
defer cancel()
informers.Start(ctx.Done())
go dc.Run(5, ctx.Done())
go dc.Run(ctx, 5)
// Start Scheduler
setupScheduler(ctx, t, clientset, informers)
@@ -799,7 +799,7 @@ func TestTaintedNode(t *testing.T) {
defer cancel()
informers.Start(ctx.Done())
go dc.Run(5, ctx.Done())
go dc.Run(ctx, 5)
// Start Scheduler
setupScheduler(ctx, t, clientset, informers)
@@ -864,7 +864,7 @@ func TestUnschedulableNodeDaemonDoesLaunchPod(t *testing.T) {
defer cancel()
informers.Start(ctx.Done())
go dc.Run(5, ctx.Done())
go dc.Run(ctx, 5)
// Start Scheduler
setupScheduler(ctx, t, clientset, informers)
@@ -872,7 +872,7 @@ func TestUnschedulableNodeDaemonDoesLaunchPod(t *testing.T) {
ds := newDaemonSet("foo", ns.Name)
ds.Spec.UpdateStrategy = *strategy
ds.Spec.Template.Spec.HostNetwork = true
_, err := dsClient.Create(context.TODO(), ds, metav1.CreateOptions{})
_, err := dsClient.Create(ctx, ds, metav1.CreateOptions{})
if err != nil {
t.Fatalf("Failed to create DaemonSet: %v", err)
}
@@ -889,7 +889,7 @@ func TestUnschedulableNodeDaemonDoesLaunchPod(t *testing.T) {
},
}
_, err = nodeClient.Create(context.TODO(), node, metav1.CreateOptions{})
_, err = nodeClient.Create(ctx, node, metav1.CreateOptions{})
if err != nil {
t.Fatalf("Failed to create node: %v", err)
}
@@ -907,7 +907,7 @@ func TestUnschedulableNodeDaemonDoesLaunchPod(t *testing.T) {
},
}
_, err = nodeClient.Create(context.TODO(), nodeNU, metav1.CreateOptions{})
_, err = nodeClient.Create(ctx, nodeNU, metav1.CreateOptions{})
if err != nil {
t.Fatalf("Failed to create node: %v", err)
}