diff --git a/pkg/router/istio.go b/pkg/router/istio.go index 93cc1139..9e8a93cc 100644 --- a/pkg/router/istio.go +++ b/pkg/router/istio.go @@ -215,6 +215,12 @@ func (ir *IstioRouter) reconcileVirtualService(canary *flaggerv1.Canary) error { return fmt.Errorf("VirtualService %s.%s get query error %v", apexName, canary.Namespace, err) } + if canary.Spec.Service.Delegation { + // delegate VirtualService requires the hosts and gateway empty. + virtualService.Spec.Gateways = []string{} + virtualService.Spec.Hosts = []string{} + } + // update service but keep the original destination weights and mirror if virtualService != nil { if diff := cmp.Diff( diff --git a/test/e2e-istio-tests-delegate.sh b/test/e2e-istio-tests-delegate.sh index 9f934c15..511abd0e 100755 --- a/test/e2e-istio-tests-delegate.sh +++ b/test/e2e-istio-tests-delegate.sh @@ -70,7 +70,6 @@ spec: targetPort: 9898 portDiscovery: true delegation: true - skipAnalysis: true analysis: interval: 15s threshold: 15