(ctx context.Context)
| 85 | } |
| 86 | |
| 87 | func (f *fixture) newController(ctx context.Context) (*Controller, informers.SharedInformerFactory, kubeinformers.SharedInformerFactory) { |
| 88 | f.client = fake.NewClientset(f.objects...) |
| 89 | f.kubeclient = k8sfake.NewClientset(f.kubeobjects...) |
| 90 | |
| 91 | i := informers.NewSharedInformerFactory(f.client, noResyncPeriodFunc()) |
| 92 | k8sI := kubeinformers.NewSharedInformerFactory(f.kubeclient, noResyncPeriodFunc()) |
| 93 | |
| 94 | c := NewController(ctx, f.kubeclient, f.client, |
| 95 | k8sI.Apps().V1().Deployments(), i.Samplecontroller().V1alpha1().Foos()) |
| 96 | |
| 97 | c.foosSynced = alwaysReady |
| 98 | c.deploymentsSynced = alwaysReady |
| 99 | c.recorder = &record.FakeRecorder{} |
| 100 | |
| 101 | for _, f := range f.fooLister { |
| 102 | i.Samplecontroller().V1alpha1().Foos().Informer().GetIndexer().Add(f) |
| 103 | } |
| 104 | |
| 105 | for _, d := range f.deploymentLister { |
| 106 | k8sI.Apps().V1().Deployments().Informer().GetIndexer().Add(d) |
| 107 | } |
| 108 | |
| 109 | return c, i, k8sI |
| 110 | } |
| 111 | |
| 112 | func (f *fixture) run(ctx context.Context, fooRef cache.ObjectName) { |
| 113 | f.runController(ctx, fooRef, true, false) |
no test coverage detected