@@ -196,7 +196,7 @@ func TestGetRestClientConfig(t *testing.T) {
196
196
197
197
func TestUseKubeContext (t * testing.T ) {
198
198
type invocation struct {
199
- cliValue , yamlValue string
199
+ cliValue string
200
200
}
201
201
tests := []struct {
202
202
name string
@@ -208,24 +208,6 @@ func TestUseKubeContext(t *testing.T) {
208
208
invocations : nil ,
209
209
expected : "" ,
210
210
},
211
- {
212
- name : "yaml value when no CLI value is given" ,
213
- invocations : []invocation {{yamlValue : "context2" }},
214
- expected : "context2" ,
215
- },
216
- {
217
- name : "yaml value when no CLI value is given, first invocation persists" ,
218
- invocations : []invocation {
219
- {yamlValue : "context-first" },
220
- {yamlValue : "context-second" },
221
- },
222
- expected : "context-first" ,
223
- },
224
- {
225
- name : "CLI value takes precedence" ,
226
- invocations : []invocation {{cliValue : "context1" , yamlValue : "context2" }},
227
- expected : "context1" ,
228
- },
229
211
{
230
212
name : "first CLI value takes precedence" ,
231
213
invocations : []invocation {
@@ -234,45 +216,13 @@ func TestUseKubeContext(t *testing.T) {
234
216
},
235
217
expected : "context-first" ,
236
218
},
237
- {
238
- name : "mixed CLI value and yaml value - I" ,
239
- invocations : []invocation {
240
- {cliValue : "context-first" },
241
- {yamlValue : "context-second" },
242
- },
243
- expected : "context-first" ,
244
- },
245
- {
246
- name : "mixed CLI value and yaml value - II" ,
247
- invocations : []invocation {
248
- {yamlValue : "context-first" },
249
- {cliValue : "context-second" },
250
- },
251
- expected : "context-first" ,
252
- },
253
- {
254
- name : "mixed CLI value and yaml value - III" ,
255
- invocations : []invocation {
256
- {yamlValue : "context-first" },
257
- {cliValue : "context-second" , yamlValue : "context-third" },
258
- },
259
- expected : "context-first" ,
260
- },
261
- {
262
- name : "mixed CLI value and yaml value - IV" ,
263
- invocations : []invocation {
264
- {cliValue : "context-first" , yamlValue : "context-second" },
265
- {cliValue : "context-third" , yamlValue : "context-fourth" },
266
- },
267
- expected : "context-first" ,
268
- },
269
219
}
270
220
271
221
for _ , test := range tests {
272
222
testutil .Run (t , test .name , func (t * testutil.T ) {
273
223
kubeContext = ""
274
224
for _ , inv := range test .invocations {
275
- ConfigureKubeConfig ("" , inv .cliValue , inv . yamlValue )
225
+ ConfigureKubeConfig ("" , inv .cliValue )
276
226
}
277
227
278
228
t .CheckDeepEqual (test .expected , kubeContext )
0 commit comments