This repository has been archived by the owner on Mar 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
/
zz_generated_secret_mock.go
1425 lines (1332 loc) · 43.4 KB
/
zz_generated_secret_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
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package fakes
import (
context "context"
sync "sync"
v1 "github.com/rancher/terraform-controller/pkg/generated/controllers/core/v1"
generic "github.com/rancher/wrangler/pkg/generic"
v1a "k8s.io/api/core/v1"
v1b "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
var (
lockSecretControllerMockAddGenericHandler sync.RWMutex
lockSecretControllerMockAddGenericRemoveHandler sync.RWMutex
lockSecretControllerMockCache sync.RWMutex
lockSecretControllerMockCreate sync.RWMutex
lockSecretControllerMockDelete sync.RWMutex
lockSecretControllerMockEnqueue sync.RWMutex
lockSecretControllerMockGet sync.RWMutex
lockSecretControllerMockGroupVersionKind sync.RWMutex
lockSecretControllerMockInformer sync.RWMutex
lockSecretControllerMockList sync.RWMutex
lockSecretControllerMockOnChange sync.RWMutex
lockSecretControllerMockOnRemove sync.RWMutex
lockSecretControllerMockPatch sync.RWMutex
lockSecretControllerMockUpdate sync.RWMutex
lockSecretControllerMockUpdater sync.RWMutex
lockSecretControllerMockWatch sync.RWMutex
)
// Ensure, that SecretControllerMock does implement SecretController.
// If this is not the case, regenerate this file with moq.
var _ v1.SecretController = &SecretControllerMock{}
// SecretControllerMock is a mock implementation of SecretController.
//
// func TestSomethingThatUsesSecretController(t *testing.T) {
//
// // make and configure a mocked SecretController
// mockedSecretController := &SecretControllerMock{
// AddGenericHandlerFunc: func(ctx context.Context, name string, handler generic.Handler) {
// panic("mock out the AddGenericHandler method")
// },
// AddGenericRemoveHandlerFunc: func(ctx context.Context, name string, handler generic.Handler) {
// panic("mock out the AddGenericRemoveHandler method")
// },
// CacheFunc: func() v1.SecretCache {
// panic("mock out the Cache method")
// },
// CreateFunc: func(in1 *v1a.Secret) (*v1a.Secret, error) {
// panic("mock out the Create method")
// },
// DeleteFunc: func(namespace string, name string, options *v1b.DeleteOptions) error {
// panic("mock out the Delete method")
// },
// EnqueueFunc: func(namespace string, name string) {
// panic("mock out the Enqueue method")
// },
// GetFunc: func(namespace string, name string, options v1b.GetOptions) (*v1a.Secret, error) {
// panic("mock out the Get method")
// },
// GroupVersionKindFunc: func() schema.GroupVersionKind {
// panic("mock out the GroupVersionKind method")
// },
// InformerFunc: func() cache.SharedIndexInformer {
// panic("mock out the Informer method")
// },
// ListFunc: func(namespace string, opts v1b.ListOptions) (*v1a.SecretList, error) {
// panic("mock out the List method")
// },
// OnChangeFunc: func(ctx context.Context, name string, sync v1.SecretHandler) {
// panic("mock out the OnChange method")
// },
// OnRemoveFunc: func(ctx context.Context, name string, sync v1.SecretHandler) {
// panic("mock out the OnRemove method")
// },
// PatchFunc: func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Secret, error) {
// panic("mock out the Patch method")
// },
// UpdateFunc: func(in1 *v1a.Secret) (*v1a.Secret, error) {
// panic("mock out the Update method")
// },
// UpdaterFunc: func() generic.Updater {
// panic("mock out the Updater method")
// },
// WatchFunc: func(namespace string, opts v1b.ListOptions) (watch.Interface, error) {
// panic("mock out the Watch method")
// },
// }
//
// // use mockedSecretController in code that requires SecretController
// // and then make assertions.
//
// }
type SecretControllerMock struct {
// AddGenericHandlerFunc mocks the AddGenericHandler method.
AddGenericHandlerFunc func(ctx context.Context, name string, handler generic.Handler)
// AddGenericRemoveHandlerFunc mocks the AddGenericRemoveHandler method.
AddGenericRemoveHandlerFunc func(ctx context.Context, name string, handler generic.Handler)
// CacheFunc mocks the Cache method.
CacheFunc func() v1.SecretCache
// CreateFunc mocks the Create method.
CreateFunc func(in1 *v1a.Secret) (*v1a.Secret, error)
// DeleteFunc mocks the Delete method.
DeleteFunc func(namespace string, name string, options *v1b.DeleteOptions) error
// EnqueueFunc mocks the Enqueue method.
EnqueueFunc func(namespace string, name string)
// GetFunc mocks the Get method.
GetFunc func(namespace string, name string, options v1b.GetOptions) (*v1a.Secret, error)
// GroupVersionKindFunc mocks the GroupVersionKind method.
GroupVersionKindFunc func() schema.GroupVersionKind
// InformerFunc mocks the Informer method.
InformerFunc func() cache.SharedIndexInformer
// ListFunc mocks the List method.
ListFunc func(namespace string, opts v1b.ListOptions) (*v1a.SecretList, error)
// OnChangeFunc mocks the OnChange method.
OnChangeFunc func(ctx context.Context, name string, sync v1.SecretHandler)
// OnRemoveFunc mocks the OnRemove method.
OnRemoveFunc func(ctx context.Context, name string, sync v1.SecretHandler)
// PatchFunc mocks the Patch method.
PatchFunc func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Secret, error)
// UpdateFunc mocks the Update method.
UpdateFunc func(in1 *v1a.Secret) (*v1a.Secret, error)
// UpdaterFunc mocks the Updater method.
UpdaterFunc func() generic.Updater
// WatchFunc mocks the Watch method.
WatchFunc func(namespace string, opts v1b.ListOptions) (watch.Interface, error)
// calls tracks calls to the methods.
calls struct {
// AddGenericHandler holds details about calls to the AddGenericHandler method.
AddGenericHandler []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Name is the name argument value.
Name string
// Handler is the handler argument value.
Handler generic.Handler
}
// AddGenericRemoveHandler holds details about calls to the AddGenericRemoveHandler method.
AddGenericRemoveHandler []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Name is the name argument value.
Name string
// Handler is the handler argument value.
Handler generic.Handler
}
// Cache holds details about calls to the Cache method.
Cache []struct {
}
// Create holds details about calls to the Create method.
Create []struct {
// In1 is the in1 argument value.
In1 *v1a.Secret
}
// Delete holds details about calls to the Delete method.
Delete []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Options is the options argument value.
Options *v1b.DeleteOptions
}
// Enqueue holds details about calls to the Enqueue method.
Enqueue []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
}
// Get holds details about calls to the Get method.
Get []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Options is the options argument value.
Options v1b.GetOptions
}
// GroupVersionKind holds details about calls to the GroupVersionKind method.
GroupVersionKind []struct {
}
// Informer holds details about calls to the Informer method.
Informer []struct {
}
// List holds details about calls to the List method.
List []struct {
// Namespace is the namespace argument value.
Namespace string
// Opts is the opts argument value.
Opts v1b.ListOptions
}
// OnChange holds details about calls to the OnChange method.
OnChange []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Name is the name argument value.
Name string
// Sync is the sync argument value.
Sync v1.SecretHandler
}
// OnRemove holds details about calls to the OnRemove method.
OnRemove []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Name is the name argument value.
Name string
// Sync is the sync argument value.
Sync v1.SecretHandler
}
// Patch holds details about calls to the Patch method.
Patch []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Pt is the pt argument value.
Pt types.PatchType
// Data is the data argument value.
Data []byte
// Subresources is the subresources argument value.
Subresources []string
}
// Update holds details about calls to the Update method.
Update []struct {
// In1 is the in1 argument value.
In1 *v1a.Secret
}
// Updater holds details about calls to the Updater method.
Updater []struct {
}
// Watch holds details about calls to the Watch method.
Watch []struct {
// Namespace is the namespace argument value.
Namespace string
// Opts is the opts argument value.
Opts v1b.ListOptions
}
}
}
// AddGenericHandler calls AddGenericHandlerFunc.
func (mock *SecretControllerMock) AddGenericHandler(ctx context.Context, name string, handler generic.Handler) {
if mock.AddGenericHandlerFunc == nil {
panic("SecretControllerMock.AddGenericHandlerFunc: method is nil but SecretController.AddGenericHandler was just called")
}
callInfo := struct {
Ctx context.Context
Name string
Handler generic.Handler
}{
Ctx: ctx,
Name: name,
Handler: handler,
}
lockSecretControllerMockAddGenericHandler.Lock()
mock.calls.AddGenericHandler = append(mock.calls.AddGenericHandler, callInfo)
lockSecretControllerMockAddGenericHandler.Unlock()
mock.AddGenericHandlerFunc(ctx, name, handler)
}
// AddGenericHandlerCalls gets all the calls that were made to AddGenericHandler.
// Check the length with:
// len(mockedSecretController.AddGenericHandlerCalls())
func (mock *SecretControllerMock) AddGenericHandlerCalls() []struct {
Ctx context.Context
Name string
Handler generic.Handler
} {
var calls []struct {
Ctx context.Context
Name string
Handler generic.Handler
}
lockSecretControllerMockAddGenericHandler.RLock()
calls = mock.calls.AddGenericHandler
lockSecretControllerMockAddGenericHandler.RUnlock()
return calls
}
// AddGenericRemoveHandler calls AddGenericRemoveHandlerFunc.
func (mock *SecretControllerMock) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler) {
if mock.AddGenericRemoveHandlerFunc == nil {
panic("SecretControllerMock.AddGenericRemoveHandlerFunc: method is nil but SecretController.AddGenericRemoveHandler was just called")
}
callInfo := struct {
Ctx context.Context
Name string
Handler generic.Handler
}{
Ctx: ctx,
Name: name,
Handler: handler,
}
lockSecretControllerMockAddGenericRemoveHandler.Lock()
mock.calls.AddGenericRemoveHandler = append(mock.calls.AddGenericRemoveHandler, callInfo)
lockSecretControllerMockAddGenericRemoveHandler.Unlock()
mock.AddGenericRemoveHandlerFunc(ctx, name, handler)
}
// AddGenericRemoveHandlerCalls gets all the calls that were made to AddGenericRemoveHandler.
// Check the length with:
// len(mockedSecretController.AddGenericRemoveHandlerCalls())
func (mock *SecretControllerMock) AddGenericRemoveHandlerCalls() []struct {
Ctx context.Context
Name string
Handler generic.Handler
} {
var calls []struct {
Ctx context.Context
Name string
Handler generic.Handler
}
lockSecretControllerMockAddGenericRemoveHandler.RLock()
calls = mock.calls.AddGenericRemoveHandler
lockSecretControllerMockAddGenericRemoveHandler.RUnlock()
return calls
}
// Cache calls CacheFunc.
func (mock *SecretControllerMock) Cache() v1.SecretCache {
if mock.CacheFunc == nil {
panic("SecretControllerMock.CacheFunc: method is nil but SecretController.Cache was just called")
}
callInfo := struct {
}{}
lockSecretControllerMockCache.Lock()
mock.calls.Cache = append(mock.calls.Cache, callInfo)
lockSecretControllerMockCache.Unlock()
return mock.CacheFunc()
}
// CacheCalls gets all the calls that were made to Cache.
// Check the length with:
// len(mockedSecretController.CacheCalls())
func (mock *SecretControllerMock) CacheCalls() []struct {
} {
var calls []struct {
}
lockSecretControllerMockCache.RLock()
calls = mock.calls.Cache
lockSecretControllerMockCache.RUnlock()
return calls
}
// Create calls CreateFunc.
func (mock *SecretControllerMock) Create(in1 *v1a.Secret) (*v1a.Secret, error) {
if mock.CreateFunc == nil {
panic("SecretControllerMock.CreateFunc: method is nil but SecretController.Create was just called")
}
callInfo := struct {
In1 *v1a.Secret
}{
In1: in1,
}
lockSecretControllerMockCreate.Lock()
mock.calls.Create = append(mock.calls.Create, callInfo)
lockSecretControllerMockCreate.Unlock()
return mock.CreateFunc(in1)
}
// CreateCalls gets all the calls that were made to Create.
// Check the length with:
// len(mockedSecretController.CreateCalls())
func (mock *SecretControllerMock) CreateCalls() []struct {
In1 *v1a.Secret
} {
var calls []struct {
In1 *v1a.Secret
}
lockSecretControllerMockCreate.RLock()
calls = mock.calls.Create
lockSecretControllerMockCreate.RUnlock()
return calls
}
// Delete calls DeleteFunc.
func (mock *SecretControllerMock) Delete(namespace string, name string, options *v1b.DeleteOptions) error {
if mock.DeleteFunc == nil {
panic("SecretControllerMock.DeleteFunc: method is nil but SecretController.Delete was just called")
}
callInfo := struct {
Namespace string
Name string
Options *v1b.DeleteOptions
}{
Namespace: namespace,
Name: name,
Options: options,
}
lockSecretControllerMockDelete.Lock()
mock.calls.Delete = append(mock.calls.Delete, callInfo)
lockSecretControllerMockDelete.Unlock()
return mock.DeleteFunc(namespace, name, options)
}
// DeleteCalls gets all the calls that were made to Delete.
// Check the length with:
// len(mockedSecretController.DeleteCalls())
func (mock *SecretControllerMock) DeleteCalls() []struct {
Namespace string
Name string
Options *v1b.DeleteOptions
} {
var calls []struct {
Namespace string
Name string
Options *v1b.DeleteOptions
}
lockSecretControllerMockDelete.RLock()
calls = mock.calls.Delete
lockSecretControllerMockDelete.RUnlock()
return calls
}
// Enqueue calls EnqueueFunc.
func (mock *SecretControllerMock) Enqueue(namespace string, name string) {
if mock.EnqueueFunc == nil {
panic("SecretControllerMock.EnqueueFunc: method is nil but SecretController.Enqueue was just called")
}
callInfo := struct {
Namespace string
Name string
}{
Namespace: namespace,
Name: name,
}
lockSecretControllerMockEnqueue.Lock()
mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo)
lockSecretControllerMockEnqueue.Unlock()
mock.EnqueueFunc(namespace, name)
}
// EnqueueCalls gets all the calls that were made to Enqueue.
// Check the length with:
// len(mockedSecretController.EnqueueCalls())
func (mock *SecretControllerMock) EnqueueCalls() []struct {
Namespace string
Name string
} {
var calls []struct {
Namespace string
Name string
}
lockSecretControllerMockEnqueue.RLock()
calls = mock.calls.Enqueue
lockSecretControllerMockEnqueue.RUnlock()
return calls
}
// Get calls GetFunc.
func (mock *SecretControllerMock) Get(namespace string, name string, options v1b.GetOptions) (*v1a.Secret, error) {
if mock.GetFunc == nil {
panic("SecretControllerMock.GetFunc: method is nil but SecretController.Get was just called")
}
callInfo := struct {
Namespace string
Name string
Options v1b.GetOptions
}{
Namespace: namespace,
Name: name,
Options: options,
}
lockSecretControllerMockGet.Lock()
mock.calls.Get = append(mock.calls.Get, callInfo)
lockSecretControllerMockGet.Unlock()
return mock.GetFunc(namespace, name, options)
}
// GetCalls gets all the calls that were made to Get.
// Check the length with:
// len(mockedSecretController.GetCalls())
func (mock *SecretControllerMock) GetCalls() []struct {
Namespace string
Name string
Options v1b.GetOptions
} {
var calls []struct {
Namespace string
Name string
Options v1b.GetOptions
}
lockSecretControllerMockGet.RLock()
calls = mock.calls.Get
lockSecretControllerMockGet.RUnlock()
return calls
}
// GroupVersionKind calls GroupVersionKindFunc.
func (mock *SecretControllerMock) GroupVersionKind() schema.GroupVersionKind {
if mock.GroupVersionKindFunc == nil {
panic("SecretControllerMock.GroupVersionKindFunc: method is nil but SecretController.GroupVersionKind was just called")
}
callInfo := struct {
}{}
lockSecretControllerMockGroupVersionKind.Lock()
mock.calls.GroupVersionKind = append(mock.calls.GroupVersionKind, callInfo)
lockSecretControllerMockGroupVersionKind.Unlock()
return mock.GroupVersionKindFunc()
}
// GroupVersionKindCalls gets all the calls that were made to GroupVersionKind.
// Check the length with:
// len(mockedSecretController.GroupVersionKindCalls())
func (mock *SecretControllerMock) GroupVersionKindCalls() []struct {
} {
var calls []struct {
}
lockSecretControllerMockGroupVersionKind.RLock()
calls = mock.calls.GroupVersionKind
lockSecretControllerMockGroupVersionKind.RUnlock()
return calls
}
// Informer calls InformerFunc.
func (mock *SecretControllerMock) Informer() cache.SharedIndexInformer {
if mock.InformerFunc == nil {
panic("SecretControllerMock.InformerFunc: method is nil but SecretController.Informer was just called")
}
callInfo := struct {
}{}
lockSecretControllerMockInformer.Lock()
mock.calls.Informer = append(mock.calls.Informer, callInfo)
lockSecretControllerMockInformer.Unlock()
return mock.InformerFunc()
}
// InformerCalls gets all the calls that were made to Informer.
// Check the length with:
// len(mockedSecretController.InformerCalls())
func (mock *SecretControllerMock) InformerCalls() []struct {
} {
var calls []struct {
}
lockSecretControllerMockInformer.RLock()
calls = mock.calls.Informer
lockSecretControllerMockInformer.RUnlock()
return calls
}
// List calls ListFunc.
func (mock *SecretControllerMock) List(namespace string, opts v1b.ListOptions) (*v1a.SecretList, error) {
if mock.ListFunc == nil {
panic("SecretControllerMock.ListFunc: method is nil but SecretController.List was just called")
}
callInfo := struct {
Namespace string
Opts v1b.ListOptions
}{
Namespace: namespace,
Opts: opts,
}
lockSecretControllerMockList.Lock()
mock.calls.List = append(mock.calls.List, callInfo)
lockSecretControllerMockList.Unlock()
return mock.ListFunc(namespace, opts)
}
// ListCalls gets all the calls that were made to List.
// Check the length with:
// len(mockedSecretController.ListCalls())
func (mock *SecretControllerMock) ListCalls() []struct {
Namespace string
Opts v1b.ListOptions
} {
var calls []struct {
Namespace string
Opts v1b.ListOptions
}
lockSecretControllerMockList.RLock()
calls = mock.calls.List
lockSecretControllerMockList.RUnlock()
return calls
}
// OnChange calls OnChangeFunc.
func (mock *SecretControllerMock) OnChange(ctx context.Context, name string, sync v1.SecretHandler) {
if mock.OnChangeFunc == nil {
panic("SecretControllerMock.OnChangeFunc: method is nil but SecretController.OnChange was just called")
}
callInfo := struct {
Ctx context.Context
Name string
Sync v1.SecretHandler
}{
Ctx: ctx,
Name: name,
Sync: sync,
}
lockSecretControllerMockOnChange.Lock()
mock.calls.OnChange = append(mock.calls.OnChange, callInfo)
lockSecretControllerMockOnChange.Unlock()
mock.OnChangeFunc(ctx, name, sync)
}
// OnChangeCalls gets all the calls that were made to OnChange.
// Check the length with:
// len(mockedSecretController.OnChangeCalls())
func (mock *SecretControllerMock) OnChangeCalls() []struct {
Ctx context.Context
Name string
Sync v1.SecretHandler
} {
var calls []struct {
Ctx context.Context
Name string
Sync v1.SecretHandler
}
lockSecretControllerMockOnChange.RLock()
calls = mock.calls.OnChange
lockSecretControllerMockOnChange.RUnlock()
return calls
}
// OnRemove calls OnRemoveFunc.
func (mock *SecretControllerMock) OnRemove(ctx context.Context, name string, sync v1.SecretHandler) {
if mock.OnRemoveFunc == nil {
panic("SecretControllerMock.OnRemoveFunc: method is nil but SecretController.OnRemove was just called")
}
callInfo := struct {
Ctx context.Context
Name string
Sync v1.SecretHandler
}{
Ctx: ctx,
Name: name,
Sync: sync,
}
lockSecretControllerMockOnRemove.Lock()
mock.calls.OnRemove = append(mock.calls.OnRemove, callInfo)
lockSecretControllerMockOnRemove.Unlock()
mock.OnRemoveFunc(ctx, name, sync)
}
// OnRemoveCalls gets all the calls that were made to OnRemove.
// Check the length with:
// len(mockedSecretController.OnRemoveCalls())
func (mock *SecretControllerMock) OnRemoveCalls() []struct {
Ctx context.Context
Name string
Sync v1.SecretHandler
} {
var calls []struct {
Ctx context.Context
Name string
Sync v1.SecretHandler
}
lockSecretControllerMockOnRemove.RLock()
calls = mock.calls.OnRemove
lockSecretControllerMockOnRemove.RUnlock()
return calls
}
// Patch calls PatchFunc.
func (mock *SecretControllerMock) Patch(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Secret, error) {
if mock.PatchFunc == nil {
panic("SecretControllerMock.PatchFunc: method is nil but SecretController.Patch was just called")
}
callInfo := struct {
Namespace string
Name string
Pt types.PatchType
Data []byte
Subresources []string
}{
Namespace: namespace,
Name: name,
Pt: pt,
Data: data,
Subresources: subresources,
}
lockSecretControllerMockPatch.Lock()
mock.calls.Patch = append(mock.calls.Patch, callInfo)
lockSecretControllerMockPatch.Unlock()
return mock.PatchFunc(namespace, name, pt, data, subresources...)
}
// PatchCalls gets all the calls that were made to Patch.
// Check the length with:
// len(mockedSecretController.PatchCalls())
func (mock *SecretControllerMock) PatchCalls() []struct {
Namespace string
Name string
Pt types.PatchType
Data []byte
Subresources []string
} {
var calls []struct {
Namespace string
Name string
Pt types.PatchType
Data []byte
Subresources []string
}
lockSecretControllerMockPatch.RLock()
calls = mock.calls.Patch
lockSecretControllerMockPatch.RUnlock()
return calls
}
// Update calls UpdateFunc.
func (mock *SecretControllerMock) Update(in1 *v1a.Secret) (*v1a.Secret, error) {
if mock.UpdateFunc == nil {
panic("SecretControllerMock.UpdateFunc: method is nil but SecretController.Update was just called")
}
callInfo := struct {
In1 *v1a.Secret
}{
In1: in1,
}
lockSecretControllerMockUpdate.Lock()
mock.calls.Update = append(mock.calls.Update, callInfo)
lockSecretControllerMockUpdate.Unlock()
return mock.UpdateFunc(in1)
}
// UpdateCalls gets all the calls that were made to Update.
// Check the length with:
// len(mockedSecretController.UpdateCalls())
func (mock *SecretControllerMock) UpdateCalls() []struct {
In1 *v1a.Secret
} {
var calls []struct {
In1 *v1a.Secret
}
lockSecretControllerMockUpdate.RLock()
calls = mock.calls.Update
lockSecretControllerMockUpdate.RUnlock()
return calls
}
// Updater calls UpdaterFunc.
func (mock *SecretControllerMock) Updater() generic.Updater {
if mock.UpdaterFunc == nil {
panic("SecretControllerMock.UpdaterFunc: method is nil but SecretController.Updater was just called")
}
callInfo := struct {
}{}
lockSecretControllerMockUpdater.Lock()
mock.calls.Updater = append(mock.calls.Updater, callInfo)
lockSecretControllerMockUpdater.Unlock()
return mock.UpdaterFunc()
}
// UpdaterCalls gets all the calls that were made to Updater.
// Check the length with:
// len(mockedSecretController.UpdaterCalls())
func (mock *SecretControllerMock) UpdaterCalls() []struct {
} {
var calls []struct {
}
lockSecretControllerMockUpdater.RLock()
calls = mock.calls.Updater
lockSecretControllerMockUpdater.RUnlock()
return calls
}
// Watch calls WatchFunc.
func (mock *SecretControllerMock) Watch(namespace string, opts v1b.ListOptions) (watch.Interface, error) {
if mock.WatchFunc == nil {
panic("SecretControllerMock.WatchFunc: method is nil but SecretController.Watch was just called")
}
callInfo := struct {
Namespace string
Opts v1b.ListOptions
}{
Namespace: namespace,
Opts: opts,
}
lockSecretControllerMockWatch.Lock()
mock.calls.Watch = append(mock.calls.Watch, callInfo)
lockSecretControllerMockWatch.Unlock()
return mock.WatchFunc(namespace, opts)
}
// WatchCalls gets all the calls that were made to Watch.
// Check the length with:
// len(mockedSecretController.WatchCalls())
func (mock *SecretControllerMock) WatchCalls() []struct {
Namespace string
Opts v1b.ListOptions
} {
var calls []struct {
Namespace string
Opts v1b.ListOptions
}
lockSecretControllerMockWatch.RLock()
calls = mock.calls.Watch
lockSecretControllerMockWatch.RUnlock()
return calls
}
var (
lockSecretClientMockCreate sync.RWMutex
lockSecretClientMockDelete sync.RWMutex
lockSecretClientMockGet sync.RWMutex
lockSecretClientMockList sync.RWMutex
lockSecretClientMockPatch sync.RWMutex
lockSecretClientMockUpdate sync.RWMutex
lockSecretClientMockWatch sync.RWMutex
)
// Ensure, that SecretClientMock does implement SecretClient.
// If this is not the case, regenerate this file with moq.
var _ v1.SecretClient = &SecretClientMock{}
// SecretClientMock is a mock implementation of SecretClient.
//
// func TestSomethingThatUsesSecretClient(t *testing.T) {
//
// // make and configure a mocked SecretClient
// mockedSecretClient := &SecretClientMock{
// CreateFunc: func(in1 *v1a.Secret) (*v1a.Secret, error) {
// panic("mock out the Create method")
// },
// DeleteFunc: func(namespace string, name string, options *v1b.DeleteOptions) error {
// panic("mock out the Delete method")
// },
// GetFunc: func(namespace string, name string, options v1b.GetOptions) (*v1a.Secret, error) {
// panic("mock out the Get method")
// },
// ListFunc: func(namespace string, opts v1b.ListOptions) (*v1a.SecretList, error) {
// panic("mock out the List method")
// },
// PatchFunc: func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Secret, error) {
// panic("mock out the Patch method")
// },
// UpdateFunc: func(in1 *v1a.Secret) (*v1a.Secret, error) {
// panic("mock out the Update method")
// },
// WatchFunc: func(namespace string, opts v1b.ListOptions) (watch.Interface, error) {
// panic("mock out the Watch method")
// },
// }
//
// // use mockedSecretClient in code that requires SecretClient
// // and then make assertions.
//
// }
type SecretClientMock struct {
// CreateFunc mocks the Create method.
CreateFunc func(in1 *v1a.Secret) (*v1a.Secret, error)
// DeleteFunc mocks the Delete method.
DeleteFunc func(namespace string, name string, options *v1b.DeleteOptions) error
// GetFunc mocks the Get method.
GetFunc func(namespace string, name string, options v1b.GetOptions) (*v1a.Secret, error)
// ListFunc mocks the List method.
ListFunc func(namespace string, opts v1b.ListOptions) (*v1a.SecretList, error)
// PatchFunc mocks the Patch method.
PatchFunc func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Secret, error)
// UpdateFunc mocks the Update method.
UpdateFunc func(in1 *v1a.Secret) (*v1a.Secret, error)
// WatchFunc mocks the Watch method.
WatchFunc func(namespace string, opts v1b.ListOptions) (watch.Interface, error)
// calls tracks calls to the methods.
calls struct {
// Create holds details about calls to the Create method.
Create []struct {
// In1 is the in1 argument value.
In1 *v1a.Secret
}
// Delete holds details about calls to the Delete method.
Delete []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Options is the options argument value.
Options *v1b.DeleteOptions
}
// Get holds details about calls to the Get method.
Get []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Options is the options argument value.
Options v1b.GetOptions
}
// List holds details about calls to the List method.
List []struct {
// Namespace is the namespace argument value.
Namespace string
// Opts is the opts argument value.
Opts v1b.ListOptions
}
// Patch holds details about calls to the Patch method.
Patch []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Pt is the pt argument value.
Pt types.PatchType
// Data is the data argument value.
Data []byte
// Subresources is the subresources argument value.
Subresources []string
}
// Update holds details about calls to the Update method.
Update []struct {
// In1 is the in1 argument value.
In1 *v1a.Secret
}
// Watch holds details about calls to the Watch method.
Watch []struct {
// Namespace is the namespace argument value.
Namespace string
// Opts is the opts argument value.
Opts v1b.ListOptions
}
}
}
// Create calls CreateFunc.
func (mock *SecretClientMock) Create(in1 *v1a.Secret) (*v1a.Secret, error) {
if mock.CreateFunc == nil {
panic("SecretClientMock.CreateFunc: method is nil but SecretClient.Create was just called")
}
callInfo := struct {
In1 *v1a.Secret
}{
In1: in1,
}
lockSecretClientMockCreate.Lock()
mock.calls.Create = append(mock.calls.Create, callInfo)
lockSecretClientMockCreate.Unlock()
return mock.CreateFunc(in1)
}
// CreateCalls gets all the calls that were made to Create.
// Check the length with:
// len(mockedSecretClient.CreateCalls())
func (mock *SecretClientMock) CreateCalls() []struct {
In1 *v1a.Secret
} {
var calls []struct {
In1 *v1a.Secret
}
lockSecretClientMockCreate.RLock()
calls = mock.calls.Create
lockSecretClientMockCreate.RUnlock()
return calls
}
// Delete calls DeleteFunc.
func (mock *SecretClientMock) Delete(namespace string, name string, options *v1b.DeleteOptions) error {
if mock.DeleteFunc == nil {
panic("SecretClientMock.DeleteFunc: method is nil but SecretClient.Delete was just called")
}
callInfo := struct {
Namespace string
Name string
Options *v1b.DeleteOptions
}{
Namespace: namespace,
Name: name,
Options: options,
}
lockSecretClientMockDelete.Lock()
mock.calls.Delete = append(mock.calls.Delete, callInfo)
lockSecretClientMockDelete.Unlock()
return mock.DeleteFunc(namespace, name, options)
}
// DeleteCalls gets all the calls that were made to Delete.