-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathIWorkerSliceGatewayService.go
More file actions
193 lines (152 loc) · 7.9 KB
/
IWorkerSliceGatewayService.go
File metadata and controls
193 lines (152 loc) · 7.9 KB
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
// Code generated by mockery v2.53.5. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
reconcile "sigs.k8s.io/controller-runtime/pkg/reconcile"
util "github.com/kubeslice/kubeslice-controller/util"
v1alpha1 "github.com/kubeslice/kubeslice-controller/apis/controller/v1alpha1"
workerv1alpha1 "github.com/kubeslice/kubeslice-controller/apis/worker/v1alpha1"
)
// IWorkerSliceGatewayService is an autogenerated mock type for the IWorkerSliceGatewayService type
type IWorkerSliceGatewayService struct {
mock.Mock
}
// BuildNetworkAddresses provides a mock function with given fields: sliceSubnet, sourceClusterName, destinationClusterName, clusterMap, subnetMap, clusterCidr
func (_m *IWorkerSliceGatewayService) BuildNetworkAddresses(sliceSubnet string, sourceClusterName string, destinationClusterName string, clusterMap map[string]int, subnetMap map[string]string, clusterCidr string) util.WorkerSliceGatewayNetworkAddresses {
ret := _m.Called(sliceSubnet, sourceClusterName, destinationClusterName, clusterMap, subnetMap, clusterCidr)
if len(ret) == 0 {
panic("no return value specified for BuildNetworkAddresses")
}
var r0 util.WorkerSliceGatewayNetworkAddresses
if rf, ok := ret.Get(0).(func(string, string, string, map[string]int, map[string]string, string) util.WorkerSliceGatewayNetworkAddresses); ok {
r0 = rf(sliceSubnet, sourceClusterName, destinationClusterName, clusterMap, subnetMap, clusterCidr)
} else {
r0 = ret.Get(0).(util.WorkerSliceGatewayNetworkAddresses)
}
return r0
}
// CreateMinimumWorkerSliceGateways provides a mock function with given fields: ctx, sliceName, clusterNames, namespace, label, clusterMap, subnetMap, sliceSubnet, clusterCidr, sliceGwSvcTypeMap
func (_m *IWorkerSliceGatewayService) CreateMinimumWorkerSliceGateways(ctx context.Context, sliceName string, clusterNames []string, namespace string, label map[string]string, clusterMap map[string]int, subnetMap map[string]string, sliceSubnet string, clusterCidr string, sliceGwSvcTypeMap map[string]*v1alpha1.SliceGatewayServiceType) (reconcile.Result, error) {
ret := _m.Called(ctx, sliceName, clusterNames, namespace, label, clusterMap, subnetMap, sliceSubnet, clusterCidr, sliceGwSvcTypeMap)
if len(ret) == 0 {
panic("no return value specified for CreateMinimumWorkerSliceGateways")
}
var r0 reconcile.Result
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, []string, string, map[string]string, map[string]int, map[string]string, string, string, map[string]*v1alpha1.SliceGatewayServiceType) (reconcile.Result, error)); ok {
return rf(ctx, sliceName, clusterNames, namespace, label, clusterMap, subnetMap, sliceSubnet, clusterCidr, sliceGwSvcTypeMap)
}
if rf, ok := ret.Get(0).(func(context.Context, string, []string, string, map[string]string, map[string]int, map[string]string, string, string, map[string]*v1alpha1.SliceGatewayServiceType) reconcile.Result); ok {
r0 = rf(ctx, sliceName, clusterNames, namespace, label, clusterMap, subnetMap, sliceSubnet, clusterCidr, sliceGwSvcTypeMap)
} else {
r0 = ret.Get(0).(reconcile.Result)
}
if rf, ok := ret.Get(1).(func(context.Context, string, []string, string, map[string]string, map[string]int, map[string]string, string, string, map[string]*v1alpha1.SliceGatewayServiceType) error); ok {
r1 = rf(ctx, sliceName, clusterNames, namespace, label, clusterMap, subnetMap, sliceSubnet, clusterCidr, sliceGwSvcTypeMap)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteWorkerSliceGatewaysByLabel provides a mock function with given fields: ctx, label, namespace
func (_m *IWorkerSliceGatewayService) DeleteWorkerSliceGatewaysByLabel(ctx context.Context, label map[string]string, namespace string) error {
ret := _m.Called(ctx, label, namespace)
if len(ret) == 0 {
panic("no return value specified for DeleteWorkerSliceGatewaysByLabel")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, map[string]string, string) error); ok {
r0 = rf(ctx, label, namespace)
} else {
r0 = ret.Error(0)
}
return r0
}
// GenerateCerts provides a mock function with given fields: ctx, sliceName, namespace, gatewayProtocol, serverGateway, clientGateway, gatewayAddresses
func (_m *IWorkerSliceGatewayService) GenerateCerts(ctx context.Context, sliceName string, namespace string, gatewayProtocol string, serverGateway *workerv1alpha1.WorkerSliceGateway, clientGateway *workerv1alpha1.WorkerSliceGateway, gatewayAddresses util.WorkerSliceGatewayNetworkAddresses) error {
ret := _m.Called(ctx, sliceName, namespace, gatewayProtocol, serverGateway, clientGateway, gatewayAddresses)
if len(ret) == 0 {
panic("no return value specified for GenerateCerts")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *workerv1alpha1.WorkerSliceGateway, *workerv1alpha1.WorkerSliceGateway, util.WorkerSliceGatewayNetworkAddresses) error); ok {
r0 = rf(ctx, sliceName, namespace, gatewayProtocol, serverGateway, clientGateway, gatewayAddresses)
} else {
r0 = ret.Error(0)
}
return r0
}
// ListWorkerSliceGateways provides a mock function with given fields: ctx, ownerLabel, namespace
func (_m *IWorkerSliceGatewayService) ListWorkerSliceGateways(ctx context.Context, ownerLabel map[string]string, namespace string) ([]workerv1alpha1.WorkerSliceGateway, error) {
ret := _m.Called(ctx, ownerLabel, namespace)
if len(ret) == 0 {
panic("no return value specified for ListWorkerSliceGateways")
}
var r0 []workerv1alpha1.WorkerSliceGateway
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, map[string]string, string) ([]workerv1alpha1.WorkerSliceGateway, error)); ok {
return rf(ctx, ownerLabel, namespace)
}
if rf, ok := ret.Get(0).(func(context.Context, map[string]string, string) []workerv1alpha1.WorkerSliceGateway); ok {
r0 = rf(ctx, ownerLabel, namespace)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]workerv1alpha1.WorkerSliceGateway)
}
}
if rf, ok := ret.Get(1).(func(context.Context, map[string]string, string) error); ok {
r1 = rf(ctx, ownerLabel, namespace)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NodeIpReconciliationOfWorkerSliceGateways provides a mock function with given fields: ctx, cluster, namespace
func (_m *IWorkerSliceGatewayService) NodeIpReconciliationOfWorkerSliceGateways(ctx context.Context, cluster *v1alpha1.Cluster, namespace string) error {
ret := _m.Called(ctx, cluster, namespace)
if len(ret) == 0 {
panic("no return value specified for NodeIpReconciliationOfWorkerSliceGateways")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *v1alpha1.Cluster, string) error); ok {
r0 = rf(ctx, cluster, namespace)
} else {
r0 = ret.Error(0)
}
return r0
}
// ReconcileWorkerSliceGateways provides a mock function with given fields: ctx, req
func (_m *IWorkerSliceGatewayService) ReconcileWorkerSliceGateways(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for ReconcileWorkerSliceGateways")
}
var r0 reconcile.Result
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, reconcile.Request) (reconcile.Result, error)); ok {
return rf(ctx, req)
}
if rf, ok := ret.Get(0).(func(context.Context, reconcile.Request) reconcile.Result); ok {
r0 = rf(ctx, req)
} else {
r0 = ret.Get(0).(reconcile.Result)
}
if rf, ok := ret.Get(1).(func(context.Context, reconcile.Request) error); ok {
r1 = rf(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewIWorkerSliceGatewayService creates a new instance of IWorkerSliceGatewayService. 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 NewIWorkerSliceGatewayService(t interface {
mock.TestingT
Cleanup(func())
}) *IWorkerSliceGatewayService {
mock := &IWorkerSliceGatewayService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}