Skip to content

Commit

Permalink
Merge pull request #745 from Nerja/delegate
Browse files Browse the repository at this point in the history
Fix for VirtualService delegation when analysis is enabled
  • Loading branch information
stefanprodan authored Dec 9, 2020
2 parents 0cfeceb + 7fc6f8a commit bfb3331
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pkg/router/istio.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion test/e2e-istio-tests-delegate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ spec:
targetPort: 9898
portDiscovery: true
delegation: true
skipAnalysis: true
analysis:
interval: 15s
threshold: 15
Expand Down

0 comments on commit bfb3331

Please sign in to comment.