/
manager_mock.go
765 lines (708 loc) · 22.1 KB
/
manager_mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package fake
import (
"context"
"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/record"
"net/http"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/config"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sync"
)
// MockManager is a mock implementation of webhook.IManager.
//
// func TestSomethingThatUsesIManager(t *testing.T) {
//
// // make and configure a mocked webhook.IManager
// mockedIManager := &MockManager{
// AddFunc: func(runnable manager.Runnable) error {
// panic("mock out the Add method")
// },
// AddHealthzCheckFunc: func(name string, check healthz.Checker) error {
// panic("mock out the AddHealthzCheck method")
// },
// AddMetricsExtraHandlerFunc: func(path string, handler http.Handler) error {
// panic("mock out the AddMetricsExtraHandler method")
// },
// AddReadyzCheckFunc: func(name string, check healthz.Checker) error {
// panic("mock out the AddReadyzCheck method")
// },
// ElectedFunc: func() <-chan struct{} {
// panic("mock out the Elected method")
// },
// GetAPIReaderFunc: func() client.Reader {
// panic("mock out the GetAPIReader method")
// },
// GetCacheFunc: func() cache.Cache {
// panic("mock out the GetCache method")
// },
// GetClientFunc: func() client.Client {
// panic("mock out the GetClient method")
// },
// GetConfigFunc: func() *rest.Config {
// panic("mock out the GetConfig method")
// },
// GetControllerOptionsFunc: func() config.Controller {
// panic("mock out the GetControllerOptions method")
// },
// GetEventRecorderForFunc: func(name string) record.EventRecorder {
// panic("mock out the GetEventRecorderFor method")
// },
// GetFieldIndexerFunc: func() client.FieldIndexer {
// panic("mock out the GetFieldIndexer method")
// },
// GetHTTPClientFunc: func() *http.Client {
// panic("mock out the GetHTTPClient method")
// },
// GetLoggerFunc: func() logr.Logger {
// panic("mock out the GetLogger method")
// },
// GetRESTMapperFunc: func() meta.RESTMapper {
// panic("mock out the GetRESTMapper method")
// },
// GetSchemeFunc: func() *runtime.Scheme {
// panic("mock out the GetScheme method")
// },
// GetWebhookServerFunc: func() webhook.Server {
// panic("mock out the GetWebhookServer method")
// },
// StartFunc: func(ctx context.Context) error {
// panic("mock out the Start method")
// },
// }
//
// // use mockedIManager in code that requires webhook.IManager
// // and then make assertions.
//
// }
type MockManager struct {
// AddFunc mocks the Add method.
AddFunc func(runnable manager.Runnable) error
// AddHealthzCheckFunc mocks the AddHealthzCheck method.
AddHealthzCheckFunc func(name string, check healthz.Checker) error
// AddMetricsExtraHandlerFunc mocks the AddMetricsExtraHandler method.
AddMetricsExtraHandlerFunc func(path string, handler http.Handler) error
// AddReadyzCheckFunc mocks the AddReadyzCheck method.
AddReadyzCheckFunc func(name string, check healthz.Checker) error
// ElectedFunc mocks the Elected method.
ElectedFunc func() <-chan struct{}
// GetAPIReaderFunc mocks the GetAPIReader method.
GetAPIReaderFunc func() client.Reader
// GetCacheFunc mocks the GetCache method.
GetCacheFunc func() cache.Cache
// GetClientFunc mocks the GetClient method.
GetClientFunc func() client.Client
// GetConfigFunc mocks the GetConfig method.
GetConfigFunc func() *rest.Config
// GetControllerOptionsFunc mocks the GetControllerOptions method.
GetControllerOptionsFunc func() config.Controller
// GetEventRecorderForFunc mocks the GetEventRecorderFor method.
GetEventRecorderForFunc func(name string) record.EventRecorder
// GetFieldIndexerFunc mocks the GetFieldIndexer method.
GetFieldIndexerFunc func() client.FieldIndexer
// GetHTTPClientFunc mocks the GetHTTPClient method.
GetHTTPClientFunc func() *http.Client
// GetLoggerFunc mocks the GetLogger method.
GetLoggerFunc func() logr.Logger
// GetRESTMapperFunc mocks the GetRESTMapper method.
GetRESTMapperFunc func() meta.RESTMapper
// GetSchemeFunc mocks the GetScheme method.
GetSchemeFunc func() *runtime.Scheme
// GetWebhookServerFunc mocks the GetWebhookServer method.
GetWebhookServerFunc func() webhook.Server
// StartFunc mocks the Start method.
StartFunc func(ctx context.Context) error
// calls tracks calls to the methods.
calls struct {
// Add holds details about calls to the Add method.
Add []struct {
// Runnable is the runnable argument value.
Runnable manager.Runnable
}
// AddHealthzCheck holds details about calls to the AddHealthzCheck method.
AddHealthzCheck []struct {
// Name is the name argument value.
Name string
// Check is the check argument value.
Check healthz.Checker
}
// AddMetricsExtraHandler holds details about calls to the AddMetricsExtraHandler method.
AddMetricsExtraHandler []struct {
// Path is the path argument value.
Path string
// Handler is the handler argument value.
Handler http.Handler
}
// AddReadyzCheck holds details about calls to the AddReadyzCheck method.
AddReadyzCheck []struct {
// Name is the name argument value.
Name string
// Check is the check argument value.
Check healthz.Checker
}
// Elected holds details about calls to the Elected method.
Elected []struct {
}
// GetAPIReader holds details about calls to the GetAPIReader method.
GetAPIReader []struct {
}
// GetCache holds details about calls to the GetCache method.
GetCache []struct {
}
// GetClient holds details about calls to the GetClient method.
GetClient []struct {
}
// GetConfig holds details about calls to the GetConfig method.
GetConfig []struct {
}
// GetControllerOptions holds details about calls to the GetControllerOptions method.
GetControllerOptions []struct {
}
// GetEventRecorderFor holds details about calls to the GetEventRecorderFor method.
GetEventRecorderFor []struct {
// Name is the name argument value.
Name string
}
// GetFieldIndexer holds details about calls to the GetFieldIndexer method.
GetFieldIndexer []struct {
}
// GetHTTPClient holds details about calls to the GetHTTPClient method.
GetHTTPClient []struct {
}
// GetLogger holds details about calls to the GetLogger method.
GetLogger []struct {
}
// GetRESTMapper holds details about calls to the GetRESTMapper method.
GetRESTMapper []struct {
}
// GetScheme holds details about calls to the GetScheme method.
GetScheme []struct {
}
// GetWebhookServer holds details about calls to the GetWebhookServer method.
GetWebhookServer []struct {
}
// Start holds details about calls to the Start method.
Start []struct {
// Ctx is the ctx argument value.
Ctx context.Context
}
}
lockAdd sync.RWMutex
lockAddHealthzCheck sync.RWMutex
lockAddMetricsExtraHandler sync.RWMutex
lockAddReadyzCheck sync.RWMutex
lockElected sync.RWMutex
lockGetAPIReader sync.RWMutex
lockGetCache sync.RWMutex
lockGetClient sync.RWMutex
lockGetConfig sync.RWMutex
lockGetControllerOptions sync.RWMutex
lockGetEventRecorderFor sync.RWMutex
lockGetFieldIndexer sync.RWMutex
lockGetHTTPClient sync.RWMutex
lockGetLogger sync.RWMutex
lockGetRESTMapper sync.RWMutex
lockGetScheme sync.RWMutex
lockGetWebhookServer sync.RWMutex
lockStart sync.RWMutex
}
// Add calls AddFunc.
func (mock *MockManager) Add(runnable manager.Runnable) error {
if mock.AddFunc == nil {
panic("MockManager.AddFunc: method is nil but IManager.Add was just called")
}
callInfo := struct {
Runnable manager.Runnable
}{
Runnable: runnable,
}
mock.lockAdd.Lock()
mock.calls.Add = append(mock.calls.Add, callInfo)
mock.lockAdd.Unlock()
return mock.AddFunc(runnable)
}
// AddCalls gets all the calls that were made to Add.
// Check the length with:
//
// len(mockedIManager.AddCalls())
func (mock *MockManager) AddCalls() []struct {
Runnable manager.Runnable
} {
var calls []struct {
Runnable manager.Runnable
}
mock.lockAdd.RLock()
calls = mock.calls.Add
mock.lockAdd.RUnlock()
return calls
}
// AddHealthzCheck calls AddHealthzCheckFunc.
func (mock *MockManager) AddHealthzCheck(name string, check healthz.Checker) error {
if mock.AddHealthzCheckFunc == nil {
panic("MockManager.AddHealthzCheckFunc: method is nil but IManager.AddHealthzCheck was just called")
}
callInfo := struct {
Name string
Check healthz.Checker
}{
Name: name,
Check: check,
}
mock.lockAddHealthzCheck.Lock()
mock.calls.AddHealthzCheck = append(mock.calls.AddHealthzCheck, callInfo)
mock.lockAddHealthzCheck.Unlock()
return mock.AddHealthzCheckFunc(name, check)
}
// AddHealthzCheckCalls gets all the calls that were made to AddHealthzCheck.
// Check the length with:
//
// len(mockedIManager.AddHealthzCheckCalls())
func (mock *MockManager) AddHealthzCheckCalls() []struct {
Name string
Check healthz.Checker
} {
var calls []struct {
Name string
Check healthz.Checker
}
mock.lockAddHealthzCheck.RLock()
calls = mock.calls.AddHealthzCheck
mock.lockAddHealthzCheck.RUnlock()
return calls
}
// AddMetricsExtraHandler calls AddMetricsExtraHandlerFunc.
func (mock *MockManager) AddMetricsExtraHandler(path string, handler http.Handler) error {
if mock.AddMetricsExtraHandlerFunc == nil {
panic("MockManager.AddMetricsExtraHandlerFunc: method is nil but IManager.AddMetricsExtraHandler was just called")
}
callInfo := struct {
Path string
Handler http.Handler
}{
Path: path,
Handler: handler,
}
mock.lockAddMetricsExtraHandler.Lock()
mock.calls.AddMetricsExtraHandler = append(mock.calls.AddMetricsExtraHandler, callInfo)
mock.lockAddMetricsExtraHandler.Unlock()
return mock.AddMetricsExtraHandlerFunc(path, handler)
}
// AddMetricsExtraHandlerCalls gets all the calls that were made to AddMetricsExtraHandler.
// Check the length with:
//
// len(mockedIManager.AddMetricsExtraHandlerCalls())
func (mock *MockManager) AddMetricsExtraHandlerCalls() []struct {
Path string
Handler http.Handler
} {
var calls []struct {
Path string
Handler http.Handler
}
mock.lockAddMetricsExtraHandler.RLock()
calls = mock.calls.AddMetricsExtraHandler
mock.lockAddMetricsExtraHandler.RUnlock()
return calls
}
// AddReadyzCheck calls AddReadyzCheckFunc.
func (mock *MockManager) AddReadyzCheck(name string, check healthz.Checker) error {
if mock.AddReadyzCheckFunc == nil {
panic("MockManager.AddReadyzCheckFunc: method is nil but IManager.AddReadyzCheck was just called")
}
callInfo := struct {
Name string
Check healthz.Checker
}{
Name: name,
Check: check,
}
mock.lockAddReadyzCheck.Lock()
mock.calls.AddReadyzCheck = append(mock.calls.AddReadyzCheck, callInfo)
mock.lockAddReadyzCheck.Unlock()
return mock.AddReadyzCheckFunc(name, check)
}
// AddReadyzCheckCalls gets all the calls that were made to AddReadyzCheck.
// Check the length with:
//
// len(mockedIManager.AddReadyzCheckCalls())
func (mock *MockManager) AddReadyzCheckCalls() []struct {
Name string
Check healthz.Checker
} {
var calls []struct {
Name string
Check healthz.Checker
}
mock.lockAddReadyzCheck.RLock()
calls = mock.calls.AddReadyzCheck
mock.lockAddReadyzCheck.RUnlock()
return calls
}
// Elected calls ElectedFunc.
func (mock *MockManager) Elected() <-chan struct{} {
if mock.ElectedFunc == nil {
panic("MockManager.ElectedFunc: method is nil but IManager.Elected was just called")
}
callInfo := struct {
}{}
mock.lockElected.Lock()
mock.calls.Elected = append(mock.calls.Elected, callInfo)
mock.lockElected.Unlock()
return mock.ElectedFunc()
}
// ElectedCalls gets all the calls that were made to Elected.
// Check the length with:
//
// len(mockedIManager.ElectedCalls())
func (mock *MockManager) ElectedCalls() []struct {
} {
var calls []struct {
}
mock.lockElected.RLock()
calls = mock.calls.Elected
mock.lockElected.RUnlock()
return calls
}
// GetAPIReader calls GetAPIReaderFunc.
func (mock *MockManager) GetAPIReader() client.Reader {
if mock.GetAPIReaderFunc == nil {
panic("MockManager.GetAPIReaderFunc: method is nil but IManager.GetAPIReader was just called")
}
callInfo := struct {
}{}
mock.lockGetAPIReader.Lock()
mock.calls.GetAPIReader = append(mock.calls.GetAPIReader, callInfo)
mock.lockGetAPIReader.Unlock()
return mock.GetAPIReaderFunc()
}
// GetAPIReaderCalls gets all the calls that were made to GetAPIReader.
// Check the length with:
//
// len(mockedIManager.GetAPIReaderCalls())
func (mock *MockManager) GetAPIReaderCalls() []struct {
} {
var calls []struct {
}
mock.lockGetAPIReader.RLock()
calls = mock.calls.GetAPIReader
mock.lockGetAPIReader.RUnlock()
return calls
}
// GetCache calls GetCacheFunc.
func (mock *MockManager) GetCache() cache.Cache {
if mock.GetCacheFunc == nil {
panic("MockManager.GetCacheFunc: method is nil but IManager.GetCache was just called")
}
callInfo := struct {
}{}
mock.lockGetCache.Lock()
mock.calls.GetCache = append(mock.calls.GetCache, callInfo)
mock.lockGetCache.Unlock()
return mock.GetCacheFunc()
}
// GetCacheCalls gets all the calls that were made to GetCache.
// Check the length with:
//
// len(mockedIManager.GetCacheCalls())
func (mock *MockManager) GetCacheCalls() []struct {
} {
var calls []struct {
}
mock.lockGetCache.RLock()
calls = mock.calls.GetCache
mock.lockGetCache.RUnlock()
return calls
}
// GetClient calls GetClientFunc.
func (mock *MockManager) GetClient() client.Client {
if mock.GetClientFunc == nil {
panic("MockManager.GetClientFunc: method is nil but IManager.GetClient was just called")
}
callInfo := struct {
}{}
mock.lockGetClient.Lock()
mock.calls.GetClient = append(mock.calls.GetClient, callInfo)
mock.lockGetClient.Unlock()
return mock.GetClientFunc()
}
// GetClientCalls gets all the calls that were made to GetClient.
// Check the length with:
//
// len(mockedIManager.GetClientCalls())
func (mock *MockManager) GetClientCalls() []struct {
} {
var calls []struct {
}
mock.lockGetClient.RLock()
calls = mock.calls.GetClient
mock.lockGetClient.RUnlock()
return calls
}
// GetConfig calls GetConfigFunc.
func (mock *MockManager) GetConfig() *rest.Config {
if mock.GetConfigFunc == nil {
panic("MockManager.GetConfigFunc: method is nil but IManager.GetConfig was just called")
}
callInfo := struct {
}{}
mock.lockGetConfig.Lock()
mock.calls.GetConfig = append(mock.calls.GetConfig, callInfo)
mock.lockGetConfig.Unlock()
return mock.GetConfigFunc()
}
// GetConfigCalls gets all the calls that were made to GetConfig.
// Check the length with:
//
// len(mockedIManager.GetConfigCalls())
func (mock *MockManager) GetConfigCalls() []struct {
} {
var calls []struct {
}
mock.lockGetConfig.RLock()
calls = mock.calls.GetConfig
mock.lockGetConfig.RUnlock()
return calls
}
// GetControllerOptions calls GetControllerOptionsFunc.
func (mock *MockManager) GetControllerOptions() config.Controller {
if mock.GetControllerOptionsFunc == nil {
panic("MockManager.GetControllerOptionsFunc: method is nil but IManager.GetControllerOptions was just called")
}
callInfo := struct {
}{}
mock.lockGetControllerOptions.Lock()
mock.calls.GetControllerOptions = append(mock.calls.GetControllerOptions, callInfo)
mock.lockGetControllerOptions.Unlock()
return mock.GetControllerOptionsFunc()
}
// GetControllerOptionsCalls gets all the calls that were made to GetControllerOptions.
// Check the length with:
//
// len(mockedIManager.GetControllerOptionsCalls())
func (mock *MockManager) GetControllerOptionsCalls() []struct {
} {
var calls []struct {
}
mock.lockGetControllerOptions.RLock()
calls = mock.calls.GetControllerOptions
mock.lockGetControllerOptions.RUnlock()
return calls
}
// GetEventRecorderFor calls GetEventRecorderForFunc.
func (mock *MockManager) GetEventRecorderFor(name string) record.EventRecorder {
if mock.GetEventRecorderForFunc == nil {
panic("MockManager.GetEventRecorderForFunc: method is nil but IManager.GetEventRecorderFor was just called")
}
callInfo := struct {
Name string
}{
Name: name,
}
mock.lockGetEventRecorderFor.Lock()
mock.calls.GetEventRecorderFor = append(mock.calls.GetEventRecorderFor, callInfo)
mock.lockGetEventRecorderFor.Unlock()
return mock.GetEventRecorderForFunc(name)
}
// GetEventRecorderForCalls gets all the calls that were made to GetEventRecorderFor.
// Check the length with:
//
// len(mockedIManager.GetEventRecorderForCalls())
func (mock *MockManager) GetEventRecorderForCalls() []struct {
Name string
} {
var calls []struct {
Name string
}
mock.lockGetEventRecorderFor.RLock()
calls = mock.calls.GetEventRecorderFor
mock.lockGetEventRecorderFor.RUnlock()
return calls
}
// GetFieldIndexer calls GetFieldIndexerFunc.
func (mock *MockManager) GetFieldIndexer() client.FieldIndexer {
if mock.GetFieldIndexerFunc == nil {
panic("MockManager.GetFieldIndexerFunc: method is nil but IManager.GetFieldIndexer was just called")
}
callInfo := struct {
}{}
mock.lockGetFieldIndexer.Lock()
mock.calls.GetFieldIndexer = append(mock.calls.GetFieldIndexer, callInfo)
mock.lockGetFieldIndexer.Unlock()
return mock.GetFieldIndexerFunc()
}
// GetFieldIndexerCalls gets all the calls that were made to GetFieldIndexer.
// Check the length with:
//
// len(mockedIManager.GetFieldIndexerCalls())
func (mock *MockManager) GetFieldIndexerCalls() []struct {
} {
var calls []struct {
}
mock.lockGetFieldIndexer.RLock()
calls = mock.calls.GetFieldIndexer
mock.lockGetFieldIndexer.RUnlock()
return calls
}
// GetHTTPClient calls GetHTTPClientFunc.
func (mock *MockManager) GetHTTPClient() *http.Client {
if mock.GetHTTPClientFunc == nil {
panic("MockManager.GetHTTPClientFunc: method is nil but IManager.GetHTTPClient was just called")
}
callInfo := struct {
}{}
mock.lockGetHTTPClient.Lock()
mock.calls.GetHTTPClient = append(mock.calls.GetHTTPClient, callInfo)
mock.lockGetHTTPClient.Unlock()
return mock.GetHTTPClientFunc()
}
// GetHTTPClientCalls gets all the calls that were made to GetHTTPClient.
// Check the length with:
//
// len(mockedIManager.GetHTTPClientCalls())
func (mock *MockManager) GetHTTPClientCalls() []struct {
} {
var calls []struct {
}
mock.lockGetHTTPClient.RLock()
calls = mock.calls.GetHTTPClient
mock.lockGetHTTPClient.RUnlock()
return calls
}
// GetLogger calls GetLoggerFunc.
func (mock *MockManager) GetLogger() logr.Logger {
if mock.GetLoggerFunc == nil {
panic("MockManager.GetLoggerFunc: method is nil but IManager.GetLogger was just called")
}
callInfo := struct {
}{}
mock.lockGetLogger.Lock()
mock.calls.GetLogger = append(mock.calls.GetLogger, callInfo)
mock.lockGetLogger.Unlock()
return mock.GetLoggerFunc()
}
// GetLoggerCalls gets all the calls that were made to GetLogger.
// Check the length with:
//
// len(mockedIManager.GetLoggerCalls())
func (mock *MockManager) GetLoggerCalls() []struct {
} {
var calls []struct {
}
mock.lockGetLogger.RLock()
calls = mock.calls.GetLogger
mock.lockGetLogger.RUnlock()
return calls
}
// GetRESTMapper calls GetRESTMapperFunc.
func (mock *MockManager) GetRESTMapper() meta.RESTMapper {
if mock.GetRESTMapperFunc == nil {
panic("MockManager.GetRESTMapperFunc: method is nil but IManager.GetRESTMapper was just called")
}
callInfo := struct {
}{}
mock.lockGetRESTMapper.Lock()
mock.calls.GetRESTMapper = append(mock.calls.GetRESTMapper, callInfo)
mock.lockGetRESTMapper.Unlock()
return mock.GetRESTMapperFunc()
}
// GetRESTMapperCalls gets all the calls that were made to GetRESTMapper.
// Check the length with:
//
// len(mockedIManager.GetRESTMapperCalls())
func (mock *MockManager) GetRESTMapperCalls() []struct {
} {
var calls []struct {
}
mock.lockGetRESTMapper.RLock()
calls = mock.calls.GetRESTMapper
mock.lockGetRESTMapper.RUnlock()
return calls
}
// GetScheme calls GetSchemeFunc.
func (mock *MockManager) GetScheme() *runtime.Scheme {
if mock.GetSchemeFunc == nil {
panic("MockManager.GetSchemeFunc: method is nil but IManager.GetScheme was just called")
}
callInfo := struct {
}{}
mock.lockGetScheme.Lock()
mock.calls.GetScheme = append(mock.calls.GetScheme, callInfo)
mock.lockGetScheme.Unlock()
return mock.GetSchemeFunc()
}
// GetSchemeCalls gets all the calls that were made to GetScheme.
// Check the length with:
//
// len(mockedIManager.GetSchemeCalls())
func (mock *MockManager) GetSchemeCalls() []struct {
} {
var calls []struct {
}
mock.lockGetScheme.RLock()
calls = mock.calls.GetScheme
mock.lockGetScheme.RUnlock()
return calls
}
// GetWebhookServer calls GetWebhookServerFunc.
func (mock *MockManager) GetWebhookServer() webhook.Server {
if mock.GetWebhookServerFunc == nil {
panic("MockManager.GetWebhookServerFunc: method is nil but IManager.GetWebhookServer was just called")
}
callInfo := struct {
}{}
mock.lockGetWebhookServer.Lock()
mock.calls.GetWebhookServer = append(mock.calls.GetWebhookServer, callInfo)
mock.lockGetWebhookServer.Unlock()
return mock.GetWebhookServerFunc()
}
// GetWebhookServerCalls gets all the calls that were made to GetWebhookServer.
// Check the length with:
//
// len(mockedIManager.GetWebhookServerCalls())
func (mock *MockManager) GetWebhookServerCalls() []struct {
} {
var calls []struct {
}
mock.lockGetWebhookServer.RLock()
calls = mock.calls.GetWebhookServer
mock.lockGetWebhookServer.RUnlock()
return calls
}
// Start calls StartFunc.
func (mock *MockManager) Start(ctx context.Context) error {
if mock.StartFunc == nil {
panic("MockManager.StartFunc: method is nil but IManager.Start was just called")
}
callInfo := struct {
Ctx context.Context
}{
Ctx: ctx,
}
mock.lockStart.Lock()
mock.calls.Start = append(mock.calls.Start, callInfo)
mock.lockStart.Unlock()
return mock.StartFunc(ctx)
}
// StartCalls gets all the calls that were made to Start.
// Check the length with:
//
// len(mockedIManager.StartCalls())
func (mock *MockManager) StartCalls() []struct {
Ctx context.Context
} {
var calls []struct {
Ctx context.Context
}
mock.lockStart.RLock()
calls = mock.calls.Start
mock.lockStart.RUnlock()
return calls
}