From ea4d9ba58db2789f00f4b82ed9c56acf63d78b54 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Tue, 11 Feb 2020 17:07:10 +0200 Subject: [PATCH] Set destination port for Istio ingress gateways --- pkg/router/istio.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/router/istio.go b/pkg/router/istio.go index 4a87b8fa..c8f04849 100644 --- a/pkg/router/istio.go +++ b/pkg/router/istio.go @@ -395,5 +395,20 @@ func makeDestination(canary *flaggerv1.Canary, host string, weight int) istiov1a Weight: weight, } + // set destination port when an ingress gateway is specified + if canary.Spec.Service.PortDiscovery && + len(canary.Spec.Service.Gateways) > 0 && + canary.Spec.Service.Gateways[0] != "mesh" { + dest = istiov1alpha3.DestinationWeight{ + Destination: istiov1alpha3.Destination{ + Host: host, + Port: &istiov1alpha3.PortSelector{ + Number: uint32(canary.Spec.Service.Port), + }, + }, + Weight: weight, + } + } + return dest }