/
volume_snapshotter.go
155 lines (125 loc) · 3.86 KB
/
volume_snapshotter.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
// Code generated by mockery v1.0.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
import runtime "k8s.io/apimachinery/pkg/runtime"
// VolumeSnapshotter is an autogenerated mock type for the VolumeSnapshotter type
type VolumeSnapshotter struct {
mock.Mock
}
// CreateSnapshot provides a mock function with given fields: volumeID, volumeAZ, tags
func (_m *VolumeSnapshotter) CreateSnapshot(volumeID string, volumeAZ string, tags map[string]string) (string, error) {
ret := _m.Called(volumeID, volumeAZ, tags)
var r0 string
if rf, ok := ret.Get(0).(func(string, string, map[string]string) string); ok {
r0 = rf(volumeID, volumeAZ, tags)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(string, string, map[string]string) error); ok {
r1 = rf(volumeID, volumeAZ, tags)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CreateVolumeFromSnapshot provides a mock function with given fields: snapshotID, volumeType, volumeAZ, iops
func (_m *VolumeSnapshotter) CreateVolumeFromSnapshot(snapshotID string, volumeType string, volumeAZ string, iops *int64) (string, error) {
ret := _m.Called(snapshotID, volumeType, volumeAZ, iops)
var r0 string
if rf, ok := ret.Get(0).(func(string, string, string, *int64) string); ok {
r0 = rf(snapshotID, volumeType, volumeAZ, iops)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(string, string, string, *int64) error); ok {
r1 = rf(snapshotID, volumeType, volumeAZ, iops)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteSnapshot provides a mock function with given fields: snapshotID
func (_m *VolumeSnapshotter) DeleteSnapshot(snapshotID string) error {
ret := _m.Called(snapshotID)
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(snapshotID)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetVolumeID provides a mock function with given fields: pv
func (_m *VolumeSnapshotter) GetVolumeID(pv runtime.Unstructured) (string, error) {
ret := _m.Called(pv)
var r0 string
if rf, ok := ret.Get(0).(func(runtime.Unstructured) string); ok {
r0 = rf(pv)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(runtime.Unstructured) error); ok {
r1 = rf(pv)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetVolumeInfo provides a mock function with given fields: volumeID, volumeAZ
func (_m *VolumeSnapshotter) GetVolumeInfo(volumeID string, volumeAZ string) (string, *int64, error) {
ret := _m.Called(volumeID, volumeAZ)
var r0 string
if rf, ok := ret.Get(0).(func(string, string) string); ok {
r0 = rf(volumeID, volumeAZ)
} else {
r0 = ret.Get(0).(string)
}
var r1 *int64
if rf, ok := ret.Get(1).(func(string, string) *int64); ok {
r1 = rf(volumeID, volumeAZ)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*int64)
}
}
var r2 error
if rf, ok := ret.Get(2).(func(string, string) error); ok {
r2 = rf(volumeID, volumeAZ)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// Init provides a mock function with given fields: config
func (_m *VolumeSnapshotter) Init(config map[string]string) error {
ret := _m.Called(config)
var r0 error
if rf, ok := ret.Get(0).(func(map[string]string) error); ok {
r0 = rf(config)
} else {
r0 = ret.Error(0)
}
return r0
}
// SetVolumeID provides a mock function with given fields: pv, volumeID
func (_m *VolumeSnapshotter) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error) {
ret := _m.Called(pv, volumeID)
var r0 runtime.Unstructured
if rf, ok := ret.Get(0).(func(runtime.Unstructured, string) runtime.Unstructured); ok {
r0 = rf(pv, volumeID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(runtime.Unstructured)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(runtime.Unstructured, string) error); ok {
r1 = rf(pv, volumeID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}