Set destination port for Istio ingress gateways

This commit is contained in:
stefanprodan
2020-02-11 17:07:10 +02:00
parent c181eb464c
commit ea4d9ba58d
+15
View File
@@ -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
}