This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
/
plugin.go
173 lines (135 loc) · 5 KB
/
plugin.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
// Code generated by mockery v1.0.1. DO NOT EDIT.
package mocks
import (
context "context"
client "sigs.k8s.io/controller-runtime/pkg/client"
core "github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/core"
k8s "github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/k8s"
mock "github.com/stretchr/testify/mock"
)
// Plugin is an autogenerated mock type for the Plugin type
type Plugin struct {
mock.Mock
}
type Plugin_BuildIdentityResource struct {
*mock.Call
}
func (_m Plugin_BuildIdentityResource) Return(_a0 client.Object, _a1 error) *Plugin_BuildIdentityResource {
return &Plugin_BuildIdentityResource{Call: _m.Call.Return(_a0, _a1)}
}
func (_m *Plugin) OnBuildIdentityResource(ctx context.Context, taskCtx core.TaskExecutionMetadata) *Plugin_BuildIdentityResource {
c_call := _m.On("BuildIdentityResource", ctx, taskCtx)
return &Plugin_BuildIdentityResource{Call: c_call}
}
func (_m *Plugin) OnBuildIdentityResourceMatch(matchers ...interface{}) *Plugin_BuildIdentityResource {
c_call := _m.On("BuildIdentityResource", matchers...)
return &Plugin_BuildIdentityResource{Call: c_call}
}
// BuildIdentityResource provides a mock function with given fields: ctx, taskCtx
func (_m *Plugin) BuildIdentityResource(ctx context.Context, taskCtx core.TaskExecutionMetadata) (client.Object, error) {
ret := _m.Called(ctx, taskCtx)
var r0 client.Object
if rf, ok := ret.Get(0).(func(context.Context, core.TaskExecutionMetadata) client.Object); ok {
r0 = rf(ctx, taskCtx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(client.Object)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, core.TaskExecutionMetadata) error); ok {
r1 = rf(ctx, taskCtx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
type Plugin_BuildResource struct {
*mock.Call
}
func (_m Plugin_BuildResource) Return(_a0 client.Object, _a1 error) *Plugin_BuildResource {
return &Plugin_BuildResource{Call: _m.Call.Return(_a0, _a1)}
}
func (_m *Plugin) OnBuildResource(ctx context.Context, taskCtx core.TaskExecutionContext) *Plugin_BuildResource {
c_call := _m.On("BuildResource", ctx, taskCtx)
return &Plugin_BuildResource{Call: c_call}
}
func (_m *Plugin) OnBuildResourceMatch(matchers ...interface{}) *Plugin_BuildResource {
c_call := _m.On("BuildResource", matchers...)
return &Plugin_BuildResource{Call: c_call}
}
// BuildResource provides a mock function with given fields: ctx, taskCtx
func (_m *Plugin) BuildResource(ctx context.Context, taskCtx core.TaskExecutionContext) (client.Object, error) {
ret := _m.Called(ctx, taskCtx)
var r0 client.Object
if rf, ok := ret.Get(0).(func(context.Context, core.TaskExecutionContext) client.Object); ok {
r0 = rf(ctx, taskCtx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(client.Object)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, core.TaskExecutionContext) error); ok {
r1 = rf(ctx, taskCtx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
type Plugin_GetProperties struct {
*mock.Call
}
func (_m Plugin_GetProperties) Return(_a0 k8s.PluginProperties) *Plugin_GetProperties {
return &Plugin_GetProperties{Call: _m.Call.Return(_a0)}
}
func (_m *Plugin) OnGetProperties() *Plugin_GetProperties {
c_call := _m.On("GetProperties")
return &Plugin_GetProperties{Call: c_call}
}
func (_m *Plugin) OnGetPropertiesMatch(matchers ...interface{}) *Plugin_GetProperties {
c_call := _m.On("GetProperties", matchers...)
return &Plugin_GetProperties{Call: c_call}
}
// GetProperties provides a mock function with given fields:
func (_m *Plugin) GetProperties() k8s.PluginProperties {
ret := _m.Called()
var r0 k8s.PluginProperties
if rf, ok := ret.Get(0).(func() k8s.PluginProperties); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(k8s.PluginProperties)
}
return r0
}
type Plugin_GetTaskPhase struct {
*mock.Call
}
func (_m Plugin_GetTaskPhase) Return(_a0 core.PhaseInfo, _a1 error) *Plugin_GetTaskPhase {
return &Plugin_GetTaskPhase{Call: _m.Call.Return(_a0, _a1)}
}
func (_m *Plugin) OnGetTaskPhase(ctx context.Context, pluginContext k8s.PluginContext, resource client.Object) *Plugin_GetTaskPhase {
c_call := _m.On("GetTaskPhase", ctx, pluginContext, resource)
return &Plugin_GetTaskPhase{Call: c_call}
}
func (_m *Plugin) OnGetTaskPhaseMatch(matchers ...interface{}) *Plugin_GetTaskPhase {
c_call := _m.On("GetTaskPhase", matchers...)
return &Plugin_GetTaskPhase{Call: c_call}
}
// GetTaskPhase provides a mock function with given fields: ctx, pluginContext, resource
func (_m *Plugin) GetTaskPhase(ctx context.Context, pluginContext k8s.PluginContext, resource client.Object) (core.PhaseInfo, error) {
ret := _m.Called(ctx, pluginContext, resource)
var r0 core.PhaseInfo
if rf, ok := ret.Get(0).(func(context.Context, k8s.PluginContext, client.Object) core.PhaseInfo); ok {
r0 = rf(ctx, pluginContext, resource)
} else {
r0 = ret.Get(0).(core.PhaseInfo)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, k8s.PluginContext, client.Object) error); ok {
r1 = rf(ctx, pluginContext, resource)
} else {
r1 = ret.Error(1)
}
return r0, r1
}