File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -282,8 +282,11 @@ func TestALBController_GetServiceNodePort(t *testing.T) {
282
282
serviceStore .Add (& api.Service {
283
283
ObjectMeta : metav1.ObjectMeta {Name : "service1" },
284
284
Spec : api.ServiceSpec {
285
- Type : api .ServiceTypeNodePort ,
286
- Ports : []api.ServicePort {{Port : 4000 , NodePort : 8000 }},
285
+ Type : api .ServiceTypeNodePort ,
286
+ Ports : []api.ServicePort {
287
+ {Port : 4000 , NodePort : 8000 },
288
+ {Port : 4002 , NodePort : 8020 },
289
+ },
287
290
},
288
291
})
289
292
serviceStore .Add (& api.Service {
@@ -299,7 +302,12 @@ func TestALBController_GetServiceNodePort(t *testing.T) {
299
302
},
300
303
}
301
304
302
- np , err := ac .GetServiceNodePort ("service1" , 4000 )
305
+ np , err := ac .GetServiceNodePort ("service1" , 4002 )
306
+ if * np != 8020 {
307
+ t .Errorf ("Expected node port for service1 to be 8020" )
308
+ }
309
+
310
+ np , err = ac .GetServiceNodePort ("service1" , 4000 )
303
311
if * np != 8000 {
304
312
t .Errorf ("Expected node port for service1 to be 8000" )
305
313
}
You can’t perform that action at this time.
0 commit comments