-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
WorkflowArchive.go
216 lines (175 loc) · 6.26 KB
/
WorkflowArchive.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
// Code generated by mockery v2.26.0. DO NOT EDIT.
package mocks
import (
mock "github.com/stretchr/testify/mock"
labels "k8s.io/apimachinery/pkg/labels"
time "time"
v1alpha1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
)
// WorkflowArchive is an autogenerated mock type for the WorkflowArchive type
type WorkflowArchive struct {
mock.Mock
}
// ArchiveWorkflow provides a mock function with given fields: wf
func (_m *WorkflowArchive) ArchiveWorkflow(wf *v1alpha1.Workflow) error {
ret := _m.Called(wf)
var r0 error
if rf, ok := ret.Get(0).(func(*v1alpha1.Workflow) error); ok {
r0 = rf(wf)
} else {
r0 = ret.Error(0)
}
return r0
}
// CountWorkflows provides a mock function with given fields: namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements
func (_m *WorkflowArchive) CountWorkflows(namespace string, name string, namePrefix string, minStartAt time.Time, maxStartAt time.Time, labelRequirements labels.Requirements) (int64, error) {
ret := _m.Called(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements)
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(string, string, string, time.Time, time.Time, labels.Requirements) (int64, error)); ok {
return rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements)
}
if rf, ok := ret.Get(0).(func(string, string, string, time.Time, time.Time, labels.Requirements) int64); ok {
r0 = rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(string, string, string, time.Time, time.Time, labels.Requirements) error); ok {
r1 = rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteExpiredWorkflows provides a mock function with given fields: ttl
func (_m *WorkflowArchive) DeleteExpiredWorkflows(ttl time.Duration) error {
ret := _m.Called(ttl)
var r0 error
if rf, ok := ret.Get(0).(func(time.Duration) error); ok {
r0 = rf(ttl)
} else {
r0 = ret.Error(0)
}
return r0
}
// DeleteWorkflow provides a mock function with given fields: uid
func (_m *WorkflowArchive) DeleteWorkflow(uid string) error {
ret := _m.Called(uid)
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(uid)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetWorkflow provides a mock function with given fields: uid, namespace, name
func (_m *WorkflowArchive) GetWorkflow(uid string, namespace string, name string) (*v1alpha1.Workflow, error) {
ret := _m.Called(uid, namespace, name)
var r0 *v1alpha1.Workflow
var r1 error
if rf, ok := ret.Get(0).(func(string, string, string) (*v1alpha1.Workflow, error)); ok {
return rf(uid, namespace, name)
}
if rf, ok := ret.Get(0).(func(string, string, string) *v1alpha1.Workflow); ok {
r0 = rf(uid, namespace, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1alpha1.Workflow)
}
}
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
r1 = rf(uid, namespace, name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IsEnabled provides a mock function with given fields:
func (_m *WorkflowArchive) IsEnabled() bool {
ret := _m.Called()
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// ListWorkflows provides a mock function with given fields: namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements, limit, offset
func (_m *WorkflowArchive) ListWorkflows(namespace string, name string, namePrefix string, minStartAt time.Time, maxStartAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (v1alpha1.Workflows, error) {
ret := _m.Called(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements, limit, offset)
var r0 v1alpha1.Workflows
var r1 error
if rf, ok := ret.Get(0).(func(string, string, string, time.Time, time.Time, labels.Requirements, int, int) (v1alpha1.Workflows, error)); ok {
return rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements, limit, offset)
}
if rf, ok := ret.Get(0).(func(string, string, string, time.Time, time.Time, labels.Requirements, int, int) v1alpha1.Workflows); ok {
r0 = rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements, limit, offset)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(v1alpha1.Workflows)
}
}
if rf, ok := ret.Get(1).(func(string, string, string, time.Time, time.Time, labels.Requirements, int, int) error); ok {
r1 = rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements, limit, offset)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListWorkflowsLabelKeys provides a mock function with given fields:
func (_m *WorkflowArchive) ListWorkflowsLabelKeys() (*v1alpha1.LabelKeys, error) {
ret := _m.Called()
var r0 *v1alpha1.LabelKeys
var r1 error
if rf, ok := ret.Get(0).(func() (*v1alpha1.LabelKeys, error)); ok {
return rf()
}
if rf, ok := ret.Get(0).(func() *v1alpha1.LabelKeys); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1alpha1.LabelKeys)
}
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListWorkflowsLabelValues provides a mock function with given fields: key
func (_m *WorkflowArchive) ListWorkflowsLabelValues(key string) (*v1alpha1.LabelValues, error) {
ret := _m.Called(key)
var r0 *v1alpha1.LabelValues
var r1 error
if rf, ok := ret.Get(0).(func(string) (*v1alpha1.LabelValues, error)); ok {
return rf(key)
}
if rf, ok := ret.Get(0).(func(string) *v1alpha1.LabelValues); ok {
r0 = rf(key)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1alpha1.LabelValues)
}
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(key)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
type mockConstructorTestingTNewWorkflowArchive interface {
mock.TestingT
Cleanup(func())
}
// NewWorkflowArchive creates a new instance of WorkflowArchive. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewWorkflowArchive(t mockConstructorTestingTNewWorkflowArchive) *WorkflowArchive {
mock := &WorkflowArchive{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}