/
provisioner.go
220 lines (189 loc) · 7.77 KB
/
provisioner.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
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/juju/juju/worker/provisioner (interfaces: ContainerMachine,ContainerMachineGetter,TaskAPI)
//
// Generated by this command:
//
// mockgen -package mocks -destination mocks/provisioner.go github.com/juju/juju/worker/provisioner ContainerMachine,ContainerMachineGetter,TaskAPI
//
// Package mocks is a generated GoMock package.
package mocks
import (
reflect "reflect"
provisioner "github.com/juju/juju/api/agent/provisioner"
instance "github.com/juju/juju/core/instance"
life "github.com/juju/juju/core/life"
watcher "github.com/juju/juju/core/watcher"
params "github.com/juju/juju/rpc/params"
provisioner0 "github.com/juju/juju/worker/provisioner"
names "github.com/juju/names/v5"
gomock "go.uber.org/mock/gomock"
)
// MockContainerMachine is a mock of ContainerMachine interface.
type MockContainerMachine struct {
ctrl *gomock.Controller
recorder *MockContainerMachineMockRecorder
}
// MockContainerMachineMockRecorder is the mock recorder for MockContainerMachine.
type MockContainerMachineMockRecorder struct {
mock *MockContainerMachine
}
// NewMockContainerMachine creates a new mock instance.
func NewMockContainerMachine(ctrl *gomock.Controller) *MockContainerMachine {
mock := &MockContainerMachine{ctrl: ctrl}
mock.recorder = &MockContainerMachineMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockContainerMachine) EXPECT() *MockContainerMachineMockRecorder {
return m.recorder
}
// AvailabilityZone mocks base method.
func (m *MockContainerMachine) AvailabilityZone() (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AvailabilityZone")
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// AvailabilityZone indicates an expected call of AvailabilityZone.
func (mr *MockContainerMachineMockRecorder) AvailabilityZone() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AvailabilityZone", reflect.TypeOf((*MockContainerMachine)(nil).AvailabilityZone))
}
// Life mocks base method.
func (m *MockContainerMachine) Life() life.Value {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Life")
ret0, _ := ret[0].(life.Value)
return ret0
}
// Life indicates an expected call of Life.
func (mr *MockContainerMachineMockRecorder) Life() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Life", reflect.TypeOf((*MockContainerMachine)(nil).Life))
}
// SupportedContainers mocks base method.
func (m *MockContainerMachine) SupportedContainers() ([]instance.ContainerType, bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SupportedContainers")
ret0, _ := ret[0].([]instance.ContainerType)
ret1, _ := ret[1].(bool)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
}
// SupportedContainers indicates an expected call of SupportedContainers.
func (mr *MockContainerMachineMockRecorder) SupportedContainers() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SupportedContainers", reflect.TypeOf((*MockContainerMachine)(nil).SupportedContainers))
}
// WatchContainers mocks base method.
func (m *MockContainerMachine) WatchContainers(arg0 instance.ContainerType) (watcher.StringsWatcher, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WatchContainers", arg0)
ret0, _ := ret[0].(watcher.StringsWatcher)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// WatchContainers indicates an expected call of WatchContainers.
func (mr *MockContainerMachineMockRecorder) WatchContainers(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WatchContainers", reflect.TypeOf((*MockContainerMachine)(nil).WatchContainers), arg0)
}
// MockContainerMachineGetter is a mock of ContainerMachineGetter interface.
type MockContainerMachineGetter struct {
ctrl *gomock.Controller
recorder *MockContainerMachineGetterMockRecorder
}
// MockContainerMachineGetterMockRecorder is the mock recorder for MockContainerMachineGetter.
type MockContainerMachineGetterMockRecorder struct {
mock *MockContainerMachineGetter
}
// NewMockContainerMachineGetter creates a new mock instance.
func NewMockContainerMachineGetter(ctrl *gomock.Controller) *MockContainerMachineGetter {
mock := &MockContainerMachineGetter{ctrl: ctrl}
mock.recorder = &MockContainerMachineGetterMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockContainerMachineGetter) EXPECT() *MockContainerMachineGetterMockRecorder {
return m.recorder
}
// Machines mocks base method.
func (m *MockContainerMachineGetter) Machines(arg0 ...names.MachineTag) ([]provisioner0.ContainerMachineResult, error) {
m.ctrl.T.Helper()
varargs := []any{}
for _, a := range arg0 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Machines", varargs...)
ret0, _ := ret[0].([]provisioner0.ContainerMachineResult)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Machines indicates an expected call of Machines.
func (mr *MockContainerMachineGetterMockRecorder) Machines(arg0 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Machines", reflect.TypeOf((*MockContainerMachineGetter)(nil).Machines), arg0...)
}
// MockTaskAPI is a mock of TaskAPI interface.
type MockTaskAPI struct {
ctrl *gomock.Controller
recorder *MockTaskAPIMockRecorder
}
// MockTaskAPIMockRecorder is the mock recorder for MockTaskAPI.
type MockTaskAPIMockRecorder struct {
mock *MockTaskAPI
}
// NewMockTaskAPI creates a new mock instance.
func NewMockTaskAPI(ctrl *gomock.Controller) *MockTaskAPI {
mock := &MockTaskAPI{ctrl: ctrl}
mock.recorder = &MockTaskAPIMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTaskAPI) EXPECT() *MockTaskAPIMockRecorder {
return m.recorder
}
// Machines mocks base method.
func (m *MockTaskAPI) Machines(arg0 ...names.MachineTag) ([]provisioner.MachineResult, error) {
m.ctrl.T.Helper()
varargs := []any{}
for _, a := range arg0 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Machines", varargs...)
ret0, _ := ret[0].([]provisioner.MachineResult)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Machines indicates an expected call of Machines.
func (mr *MockTaskAPIMockRecorder) Machines(arg0 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Machines", reflect.TypeOf((*MockTaskAPI)(nil).Machines), arg0...)
}
// MachinesWithTransientErrors mocks base method.
func (m *MockTaskAPI) MachinesWithTransientErrors() ([]provisioner.MachineStatusResult, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MachinesWithTransientErrors")
ret0, _ := ret[0].([]provisioner.MachineStatusResult)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MachinesWithTransientErrors indicates an expected call of MachinesWithTransientErrors.
func (mr *MockTaskAPIMockRecorder) MachinesWithTransientErrors() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MachinesWithTransientErrors", reflect.TypeOf((*MockTaskAPI)(nil).MachinesWithTransientErrors))
}
// ProvisioningInfo mocks base method.
func (m *MockTaskAPI) ProvisioningInfo(arg0 []names.MachineTag) (params.ProvisioningInfoResults, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ProvisioningInfo", arg0)
ret0, _ := ret[0].(params.ProvisioningInfoResults)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ProvisioningInfo indicates an expected call of ProvisioningInfo.
func (mr *MockTaskAPIMockRecorder) ProvisioningInfo(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProvisioningInfo", reflect.TypeOf((*MockTaskAPI)(nil).ProvisioningInfo), arg0)
}