generated from broadinstitute/golang-project-template
/
services.go
659 lines (547 loc) · 21.9 KB
/
services.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
// Code generated by mockery v2.32.4. DO NOT EDIT.
package mocks
import (
context "context"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
mock "github.com/stretchr/testify/mock"
rest "k8s.io/client-go/rest"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/core/v1"
watch "k8s.io/apimachinery/pkg/watch"
)
// Services is an autogenerated mock type for the Services type
type Services struct {
mock.Mock
}
type Services_Expecter struct {
mock *mock.Mock
}
func (_m *Services) EXPECT() *Services_Expecter {
return &Services_Expecter{mock: &_m.Mock}
}
// Apply provides a mock function with given fields: ctx, service, opts
func (_m *Services) Apply(ctx context.Context, service *v1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (*corev1.Service, error) {
ret := _m.Called(ctx, service, opts)
var r0 *corev1.Service
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *v1.ServiceApplyConfiguration, metav1.ApplyOptions) (*corev1.Service, error)); ok {
return rf(ctx, service, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, *v1.ServiceApplyConfiguration, metav1.ApplyOptions) *corev1.Service); ok {
r0 = rf(ctx, service, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.Service)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *v1.ServiceApplyConfiguration, metav1.ApplyOptions) error); ok {
r1 = rf(ctx, service, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Services_Apply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Apply'
type Services_Apply_Call struct {
*mock.Call
}
// Apply is a helper method to define mock.On call
// - ctx context.Context
// - service *v1.ServiceApplyConfiguration
// - opts metav1.ApplyOptions
func (_e *Services_Expecter) Apply(ctx interface{}, service interface{}, opts interface{}) *Services_Apply_Call {
return &Services_Apply_Call{Call: _e.mock.On("Apply", ctx, service, opts)}
}
func (_c *Services_Apply_Call) Run(run func(ctx context.Context, service *v1.ServiceApplyConfiguration, opts metav1.ApplyOptions)) *Services_Apply_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*v1.ServiceApplyConfiguration), args[2].(metav1.ApplyOptions))
})
return _c
}
func (_c *Services_Apply_Call) Return(result *corev1.Service, err error) *Services_Apply_Call {
_c.Call.Return(result, err)
return _c
}
func (_c *Services_Apply_Call) RunAndReturn(run func(context.Context, *v1.ServiceApplyConfiguration, metav1.ApplyOptions) (*corev1.Service, error)) *Services_Apply_Call {
_c.Call.Return(run)
return _c
}
// ApplyStatus provides a mock function with given fields: ctx, service, opts
func (_m *Services) ApplyStatus(ctx context.Context, service *v1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (*corev1.Service, error) {
ret := _m.Called(ctx, service, opts)
var r0 *corev1.Service
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *v1.ServiceApplyConfiguration, metav1.ApplyOptions) (*corev1.Service, error)); ok {
return rf(ctx, service, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, *v1.ServiceApplyConfiguration, metav1.ApplyOptions) *corev1.Service); ok {
r0 = rf(ctx, service, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.Service)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *v1.ServiceApplyConfiguration, metav1.ApplyOptions) error); ok {
r1 = rf(ctx, service, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Services_ApplyStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyStatus'
type Services_ApplyStatus_Call struct {
*mock.Call
}
// ApplyStatus is a helper method to define mock.On call
// - ctx context.Context
// - service *v1.ServiceApplyConfiguration
// - opts metav1.ApplyOptions
func (_e *Services_Expecter) ApplyStatus(ctx interface{}, service interface{}, opts interface{}) *Services_ApplyStatus_Call {
return &Services_ApplyStatus_Call{Call: _e.mock.On("ApplyStatus", ctx, service, opts)}
}
func (_c *Services_ApplyStatus_Call) Run(run func(ctx context.Context, service *v1.ServiceApplyConfiguration, opts metav1.ApplyOptions)) *Services_ApplyStatus_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*v1.ServiceApplyConfiguration), args[2].(metav1.ApplyOptions))
})
return _c
}
func (_c *Services_ApplyStatus_Call) Return(result *corev1.Service, err error) *Services_ApplyStatus_Call {
_c.Call.Return(result, err)
return _c
}
func (_c *Services_ApplyStatus_Call) RunAndReturn(run func(context.Context, *v1.ServiceApplyConfiguration, metav1.ApplyOptions) (*corev1.Service, error)) *Services_ApplyStatus_Call {
_c.Call.Return(run)
return _c
}
// Create provides a mock function with given fields: ctx, service, opts
func (_m *Services) Create(ctx context.Context, service *corev1.Service, opts metav1.CreateOptions) (*corev1.Service, error) {
ret := _m.Called(ctx, service, opts)
var r0 *corev1.Service
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Service, metav1.CreateOptions) (*corev1.Service, error)); ok {
return rf(ctx, service, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Service, metav1.CreateOptions) *corev1.Service); ok {
r0 = rf(ctx, service, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.Service)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *corev1.Service, metav1.CreateOptions) error); ok {
r1 = rf(ctx, service, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Services_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
type Services_Create_Call struct {
*mock.Call
}
// Create is a helper method to define mock.On call
// - ctx context.Context
// - service *corev1.Service
// - opts metav1.CreateOptions
func (_e *Services_Expecter) Create(ctx interface{}, service interface{}, opts interface{}) *Services_Create_Call {
return &Services_Create_Call{Call: _e.mock.On("Create", ctx, service, opts)}
}
func (_c *Services_Create_Call) Run(run func(ctx context.Context, service *corev1.Service, opts metav1.CreateOptions)) *Services_Create_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*corev1.Service), args[2].(metav1.CreateOptions))
})
return _c
}
func (_c *Services_Create_Call) Return(_a0 *corev1.Service, _a1 error) *Services_Create_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Services_Create_Call) RunAndReturn(run func(context.Context, *corev1.Service, metav1.CreateOptions) (*corev1.Service, error)) *Services_Create_Call {
_c.Call.Return(run)
return _c
}
// Delete provides a mock function with given fields: ctx, name, opts
func (_m *Services) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
ret := _m.Called(ctx, name, opts)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, metav1.DeleteOptions) error); ok {
r0 = rf(ctx, name, opts)
} else {
r0 = ret.Error(0)
}
return r0
}
// Services_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
type Services_Delete_Call struct {
*mock.Call
}
// Delete is a helper method to define mock.On call
// - ctx context.Context
// - name string
// - opts metav1.DeleteOptions
func (_e *Services_Expecter) Delete(ctx interface{}, name interface{}, opts interface{}) *Services_Delete_Call {
return &Services_Delete_Call{Call: _e.mock.On("Delete", ctx, name, opts)}
}
func (_c *Services_Delete_Call) Run(run func(ctx context.Context, name string, opts metav1.DeleteOptions)) *Services_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(metav1.DeleteOptions))
})
return _c
}
func (_c *Services_Delete_Call) Return(_a0 error) *Services_Delete_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Services_Delete_Call) RunAndReturn(run func(context.Context, string, metav1.DeleteOptions) error) *Services_Delete_Call {
_c.Call.Return(run)
return _c
}
// Get provides a mock function with given fields: ctx, name, opts
func (_m *Services) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Service, error) {
ret := _m.Called(ctx, name, opts)
var r0 *corev1.Service
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, metav1.GetOptions) (*corev1.Service, error)); ok {
return rf(ctx, name, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, string, metav1.GetOptions) *corev1.Service); ok {
r0 = rf(ctx, name, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.Service)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, metav1.GetOptions) error); ok {
r1 = rf(ctx, name, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Services_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
type Services_Get_Call struct {
*mock.Call
}
// Get is a helper method to define mock.On call
// - ctx context.Context
// - name string
// - opts metav1.GetOptions
func (_e *Services_Expecter) Get(ctx interface{}, name interface{}, opts interface{}) *Services_Get_Call {
return &Services_Get_Call{Call: _e.mock.On("Get", ctx, name, opts)}
}
func (_c *Services_Get_Call) Run(run func(ctx context.Context, name string, opts metav1.GetOptions)) *Services_Get_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(metav1.GetOptions))
})
return _c
}
func (_c *Services_Get_Call) Return(_a0 *corev1.Service, _a1 error) *Services_Get_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Services_Get_Call) RunAndReturn(run func(context.Context, string, metav1.GetOptions) (*corev1.Service, error)) *Services_Get_Call {
_c.Call.Return(run)
return _c
}
// List provides a mock function with given fields: ctx, opts
func (_m *Services) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceList, error) {
ret := _m.Called(ctx, opts)
var r0 *corev1.ServiceList
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) (*corev1.ServiceList, error)); ok {
return rf(ctx, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) *corev1.ServiceList); ok {
r0 = rf(ctx, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.ServiceList)
}
}
if rf, ok := ret.Get(1).(func(context.Context, metav1.ListOptions) error); ok {
r1 = rf(ctx, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Services_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
type Services_List_Call struct {
*mock.Call
}
// List is a helper method to define mock.On call
// - ctx context.Context
// - opts metav1.ListOptions
func (_e *Services_Expecter) List(ctx interface{}, opts interface{}) *Services_List_Call {
return &Services_List_Call{Call: _e.mock.On("List", ctx, opts)}
}
func (_c *Services_List_Call) Run(run func(ctx context.Context, opts metav1.ListOptions)) *Services_List_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(metav1.ListOptions))
})
return _c
}
func (_c *Services_List_Call) Return(_a0 *corev1.ServiceList, _a1 error) *Services_List_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Services_List_Call) RunAndReturn(run func(context.Context, metav1.ListOptions) (*corev1.ServiceList, error)) *Services_List_Call {
_c.Call.Return(run)
return _c
}
// Patch provides a mock function with given fields: ctx, name, pt, data, opts, subresources
func (_m *Services) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.Service, error) {
_va := make([]interface{}, len(subresources))
for _i := range subresources {
_va[_i] = subresources[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, name, pt, data, opts)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *corev1.Service
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.PatchType, []byte, metav1.PatchOptions, ...string) (*corev1.Service, error)); ok {
return rf(ctx, name, pt, data, opts, subresources...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, types.PatchType, []byte, metav1.PatchOptions, ...string) *corev1.Service); ok {
r0 = rf(ctx, name, pt, data, opts, subresources...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.Service)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, types.PatchType, []byte, metav1.PatchOptions, ...string) error); ok {
r1 = rf(ctx, name, pt, data, opts, subresources...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Services_Patch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Patch'
type Services_Patch_Call struct {
*mock.Call
}
// Patch is a helper method to define mock.On call
// - ctx context.Context
// - name string
// - pt types.PatchType
// - data []byte
// - opts metav1.PatchOptions
// - subresources ...string
func (_e *Services_Expecter) Patch(ctx interface{}, name interface{}, pt interface{}, data interface{}, opts interface{}, subresources ...interface{}) *Services_Patch_Call {
return &Services_Patch_Call{Call: _e.mock.On("Patch",
append([]interface{}{ctx, name, pt, data, opts}, subresources...)...)}
}
func (_c *Services_Patch_Call) Run(run func(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string)) *Services_Patch_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]string, len(args)-5)
for i, a := range args[5:] {
if a != nil {
variadicArgs[i] = a.(string)
}
}
run(args[0].(context.Context), args[1].(string), args[2].(types.PatchType), args[3].([]byte), args[4].(metav1.PatchOptions), variadicArgs...)
})
return _c
}
func (_c *Services_Patch_Call) Return(result *corev1.Service, err error) *Services_Patch_Call {
_c.Call.Return(result, err)
return _c
}
func (_c *Services_Patch_Call) RunAndReturn(run func(context.Context, string, types.PatchType, []byte, metav1.PatchOptions, ...string) (*corev1.Service, error)) *Services_Patch_Call {
_c.Call.Return(run)
return _c
}
// ProxyGet provides a mock function with given fields: scheme, name, port, path, params
func (_m *Services) ProxyGet(scheme string, name string, port string, path string, params map[string]string) rest.ResponseWrapper {
ret := _m.Called(scheme, name, port, path, params)
var r0 rest.ResponseWrapper
if rf, ok := ret.Get(0).(func(string, string, string, string, map[string]string) rest.ResponseWrapper); ok {
r0 = rf(scheme, name, port, path, params)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(rest.ResponseWrapper)
}
}
return r0
}
// Services_ProxyGet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProxyGet'
type Services_ProxyGet_Call struct {
*mock.Call
}
// ProxyGet is a helper method to define mock.On call
// - scheme string
// - name string
// - port string
// - path string
// - params map[string]string
func (_e *Services_Expecter) ProxyGet(scheme interface{}, name interface{}, port interface{}, path interface{}, params interface{}) *Services_ProxyGet_Call {
return &Services_ProxyGet_Call{Call: _e.mock.On("ProxyGet", scheme, name, port, path, params)}
}
func (_c *Services_ProxyGet_Call) Run(run func(scheme string, name string, port string, path string, params map[string]string)) *Services_ProxyGet_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(string), args[2].(string), args[3].(string), args[4].(map[string]string))
})
return _c
}
func (_c *Services_ProxyGet_Call) Return(_a0 rest.ResponseWrapper) *Services_ProxyGet_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Services_ProxyGet_Call) RunAndReturn(run func(string, string, string, string, map[string]string) rest.ResponseWrapper) *Services_ProxyGet_Call {
_c.Call.Return(run)
return _c
}
// Update provides a mock function with given fields: ctx, service, opts
func (_m *Services) Update(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) {
ret := _m.Called(ctx, service, opts)
var r0 *corev1.Service
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Service, metav1.UpdateOptions) (*corev1.Service, error)); ok {
return rf(ctx, service, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Service, metav1.UpdateOptions) *corev1.Service); ok {
r0 = rf(ctx, service, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.Service)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *corev1.Service, metav1.UpdateOptions) error); ok {
r1 = rf(ctx, service, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Services_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
type Services_Update_Call struct {
*mock.Call
}
// Update is a helper method to define mock.On call
// - ctx context.Context
// - service *corev1.Service
// - opts metav1.UpdateOptions
func (_e *Services_Expecter) Update(ctx interface{}, service interface{}, opts interface{}) *Services_Update_Call {
return &Services_Update_Call{Call: _e.mock.On("Update", ctx, service, opts)}
}
func (_c *Services_Update_Call) Run(run func(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions)) *Services_Update_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*corev1.Service), args[2].(metav1.UpdateOptions))
})
return _c
}
func (_c *Services_Update_Call) Return(_a0 *corev1.Service, _a1 error) *Services_Update_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Services_Update_Call) RunAndReturn(run func(context.Context, *corev1.Service, metav1.UpdateOptions) (*corev1.Service, error)) *Services_Update_Call {
_c.Call.Return(run)
return _c
}
// UpdateStatus provides a mock function with given fields: ctx, service, opts
func (_m *Services) UpdateStatus(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) {
ret := _m.Called(ctx, service, opts)
var r0 *corev1.Service
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Service, metav1.UpdateOptions) (*corev1.Service, error)); ok {
return rf(ctx, service, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Service, metav1.UpdateOptions) *corev1.Service); ok {
r0 = rf(ctx, service, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.Service)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *corev1.Service, metav1.UpdateOptions) error); ok {
r1 = rf(ctx, service, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Services_UpdateStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStatus'
type Services_UpdateStatus_Call struct {
*mock.Call
}
// UpdateStatus is a helper method to define mock.On call
// - ctx context.Context
// - service *corev1.Service
// - opts metav1.UpdateOptions
func (_e *Services_Expecter) UpdateStatus(ctx interface{}, service interface{}, opts interface{}) *Services_UpdateStatus_Call {
return &Services_UpdateStatus_Call{Call: _e.mock.On("UpdateStatus", ctx, service, opts)}
}
func (_c *Services_UpdateStatus_Call) Run(run func(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions)) *Services_UpdateStatus_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*corev1.Service), args[2].(metav1.UpdateOptions))
})
return _c
}
func (_c *Services_UpdateStatus_Call) Return(_a0 *corev1.Service, _a1 error) *Services_UpdateStatus_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Services_UpdateStatus_Call) RunAndReturn(run func(context.Context, *corev1.Service, metav1.UpdateOptions) (*corev1.Service, error)) *Services_UpdateStatus_Call {
_c.Call.Return(run)
return _c
}
// Watch provides a mock function with given fields: ctx, opts
func (_m *Services) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
ret := _m.Called(ctx, opts)
var r0 watch.Interface
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) (watch.Interface, error)); ok {
return rf(ctx, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) watch.Interface); ok {
r0 = rf(ctx, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(watch.Interface)
}
}
if rf, ok := ret.Get(1).(func(context.Context, metav1.ListOptions) error); ok {
r1 = rf(ctx, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Services_Watch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Watch'
type Services_Watch_Call struct {
*mock.Call
}
// Watch is a helper method to define mock.On call
// - ctx context.Context
// - opts metav1.ListOptions
func (_e *Services_Expecter) Watch(ctx interface{}, opts interface{}) *Services_Watch_Call {
return &Services_Watch_Call{Call: _e.mock.On("Watch", ctx, opts)}
}
func (_c *Services_Watch_Call) Run(run func(ctx context.Context, opts metav1.ListOptions)) *Services_Watch_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(metav1.ListOptions))
})
return _c
}
func (_c *Services_Watch_Call) Return(_a0 watch.Interface, _a1 error) *Services_Watch_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Services_Watch_Call) RunAndReturn(run func(context.Context, metav1.ListOptions) (watch.Interface, error)) *Services_Watch_Call {
_c.Call.Return(run)
return _c
}
// NewServices creates a new instance of Services. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewServices(t interface {
mock.TestingT
Cleanup(func())
}) *Services {
mock := &Services{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}