@@ -70,7 +70,7 @@ type expectedCommand struct {
70
70
}
71
71
72
72
func TestPlugin (t * testing.T ) {
73
- gitUrl := "https://github.com/kubernetes/kubernetes.git"
73
+ gitURL := "https://github.com/kubernetes/kubernetes.git"
74
74
revision := "2a30ce65c5ab586b98916d83385c5983edd353a1"
75
75
76
76
scenarios := []struct {
@@ -85,15 +85,15 @@ func TestPlugin(t *testing.T) {
85
85
Name : "vol1" ,
86
86
VolumeSource : v1.VolumeSource {
87
87
GitRepo : & v1.GitRepoVolumeSource {
88
- Repository : gitUrl ,
88
+ Repository : gitURL ,
89
89
Revision : revision ,
90
90
Directory : "target_dir" ,
91
91
},
92
92
},
93
93
},
94
94
expecteds : []expectedCommand {
95
95
{
96
- cmd : []string {"git" , "clone" , "--" , gitUrl , "target_dir" },
96
+ cmd : []string {"git" , "clone" , "--" , gitURL , "target_dir" },
97
97
dir : "" ,
98
98
},
99
99
{
@@ -113,14 +113,14 @@ func TestPlugin(t *testing.T) {
113
113
Name : "vol1" ,
114
114
VolumeSource : v1.VolumeSource {
115
115
GitRepo : & v1.GitRepoVolumeSource {
116
- Repository : gitUrl ,
116
+ Repository : gitURL ,
117
117
Directory : "target_dir" ,
118
118
},
119
119
},
120
120
},
121
121
expecteds : []expectedCommand {
122
122
{
123
- cmd : []string {"git" , "clone" , "--" , gitUrl , "target_dir" },
123
+ cmd : []string {"git" , "clone" , "--" , gitURL , "target_dir" },
124
124
dir : "" ,
125
125
},
126
126
},
@@ -132,13 +132,13 @@ func TestPlugin(t *testing.T) {
132
132
Name : "vol1" ,
133
133
VolumeSource : v1.VolumeSource {
134
134
GitRepo : & v1.GitRepoVolumeSource {
135
- Repository : gitUrl ,
135
+ Repository : gitURL ,
136
136
},
137
137
},
138
138
},
139
139
expecteds : []expectedCommand {
140
140
{
141
- cmd : []string {"git" , "clone" , "--" , gitUrl },
141
+ cmd : []string {"git" , "clone" , "--" , gitURL },
142
142
dir : "" ,
143
143
},
144
144
},
@@ -150,15 +150,15 @@ func TestPlugin(t *testing.T) {
150
150
Name : "vol1" ,
151
151
VolumeSource : v1.VolumeSource {
152
152
GitRepo : & v1.GitRepoVolumeSource {
153
- Repository : gitUrl ,
153
+ Repository : gitURL ,
154
154
Revision : revision ,
155
155
Directory : "" ,
156
156
},
157
157
},
158
158
},
159
159
expecteds : []expectedCommand {
160
160
{
161
- cmd : []string {"git" , "clone" , "--" , gitUrl },
161
+ cmd : []string {"git" , "clone" , "--" , gitURL },
162
162
dir : "" ,
163
163
},
164
164
{
@@ -178,15 +178,15 @@ func TestPlugin(t *testing.T) {
178
178
Name : "vol1" ,
179
179
VolumeSource : v1.VolumeSource {
180
180
GitRepo : & v1.GitRepoVolumeSource {
181
- Repository : gitUrl ,
181
+ Repository : gitURL ,
182
182
Revision : revision ,
183
183
Directory : "." ,
184
184
},
185
185
},
186
186
},
187
187
expecteds : []expectedCommand {
188
188
{
189
- cmd : []string {"git" , "clone" , "--" , gitUrl , "." },
189
+ cmd : []string {"git" , "clone" , "--" , gitURL , "." },
190
190
dir : "" ,
191
191
},
192
192
{
@@ -206,15 +206,15 @@ func TestPlugin(t *testing.T) {
206
206
Name : "vol1" ,
207
207
VolumeSource : v1.VolumeSource {
208
208
GitRepo : & v1.GitRepoVolumeSource {
209
- Repository : gitUrl ,
209
+ Repository : gitURL ,
210
210
Revision : revision ,
211
211
Directory : "./." ,
212
212
},
213
213
},
214
214
},
215
215
expecteds : []expectedCommand {
216
216
{
217
- cmd : []string {"git" , "clone" , "--" , gitUrl , "./." },
217
+ cmd : []string {"git" , "clone" , "--" , gitURL , "./." },
218
218
dir : "" ,
219
219
},
220
220
{
@@ -246,7 +246,7 @@ func TestPlugin(t *testing.T) {
246
246
Name : "vol1" ,
247
247
VolumeSource : v1.VolumeSource {
248
248
GitRepo : & v1.GitRepoVolumeSource {
249
- Repository : gitUrl ,
249
+ Repository : gitURL ,
250
250
Revision : "--bar" ,
251
251
},
252
252
},
@@ -259,7 +259,7 @@ func TestPlugin(t *testing.T) {
259
259
Name : "vol1" ,
260
260
VolumeSource : v1.VolumeSource {
261
261
GitRepo : & v1.GitRepoVolumeSource {
262
- Repository : gitUrl ,
262
+ Repository : gitURL ,
263
263
Directory : "-b" ,
264
264
},
265
265
},
@@ -330,11 +330,11 @@ func doTestPlugin(scenario struct {
330
330
allErrs = append (allErrs ,
331
331
fmt .Errorf ("SetUp() failed, volume path not created: %s" , path ))
332
332
return allErrs
333
- } else {
334
- allErrs = append (allErrs ,
335
- fmt .Errorf ("SetUp() failed: %v" , err ))
336
- return allErrs
337
333
}
334
+ allErrs = append (allErrs ,
335
+ fmt .Errorf ("SetUp() failed: %v" , err ))
336
+ return allErrs
337
+
338
338
}
339
339
340
340
// gitRepo volume should create its own empty wrapper path
0 commit comments