@@ -305,6 +305,46 @@ func TestIntegration(t *testing.T) {
305305 Type : v1 .ServiceTypeLoadBalancer ,
306306 },
307307 }),
308+ NewTestDiff ("service with named port diffs with existing" ,
309+ & v1.Service {
310+ ObjectMeta : standardObjectMeta (),
311+ Spec : v1.ServiceSpec {
312+ Ports : []v1.ServicePort {
313+ {
314+ Name : "http" ,
315+ Protocol : v1 .ProtocolTCP ,
316+ Port : 80 ,
317+ TargetPort : intstr .FromString ("http" ),
318+ },
319+ },
320+ Selector : map [string ]string {
321+ "app" : "test" ,
322+ },
323+ Type : v1 .ServiceTypeLoadBalancer ,
324+ },
325+ }).
326+ withLocalChange (func (a interface {}) {
327+ b := a .(* v1.Service )
328+ b .Spec .Ports [0 ].TargetPort = intstr .FromString ("https" )
329+ }),
330+ NewTestMatch ("service with named port matches with original" ,
331+ & v1.Service {
332+ ObjectMeta : standardObjectMeta (),
333+ Spec : v1.ServiceSpec {
334+ Ports : []v1.ServicePort {
335+ {
336+ Name : "http" ,
337+ Protocol : v1 .ProtocolTCP ,
338+ Port : 80 ,
339+ TargetPort : intstr .FromString ("http" ),
340+ },
341+ },
342+ Selector : map [string ]string {
343+ "app" : "test" ,
344+ },
345+ Type : v1 .ServiceTypeLoadBalancer ,
346+ },
347+ }),
308348 NewTestMatch ("service matches with original even if defaults are not set" ,
309349 & v1.Service {
310350 ObjectMeta : standardObjectMeta (),
0 commit comments