From 35e20406efb3a663f63b965c93170aee88d4650a Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sat, 2 Mar 2019 13:35:36 +0200 Subject: [PATCH] Append HTTP headers when configuring routing --- pkg/controller/router.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkg/controller/router.go b/pkg/controller/router.go index 13eeeab2a..8dd98585b 100644 --- a/pkg/controller/router.go +++ b/pkg/controller/router.go @@ -203,11 +203,12 @@ func (c *CanaryRouter) syncVirtualService(cd *flaggerv1.Canary) error { Gateways: gateways, Http: []istiov1alpha3.HTTPRoute{ { - Match: cd.Spec.Service.Match, - Rewrite: cd.Spec.Service.Rewrite, - Timeout: cd.Spec.Service.Timeout, - Retries: cd.Spec.Service.Retries, - Route: route, + Match: cd.Spec.Service.Match, + Rewrite: cd.Spec.Service.Rewrite, + Timeout: cd.Spec.Service.Timeout, + Retries: cd.Spec.Service.Retries, + AppendHeaders: cd.Spec.Service.AppendHeaders, + Route: route, }, }, } @@ -319,11 +320,12 @@ func (c *CanaryRouter) SetRoutes( vsCopy := vs.DeepCopy() vsCopy.Spec.Http = []istiov1alpha3.HTTPRoute{ { - Match: cd.Spec.Service.Match, - Rewrite: cd.Spec.Service.Rewrite, - Timeout: cd.Spec.Service.Timeout, - Retries: cd.Spec.Service.Retries, - Route: []istiov1alpha3.DestinationWeight{primary, canary}, + Match: cd.Spec.Service.Match, + Rewrite: cd.Spec.Service.Rewrite, + Timeout: cd.Spec.Service.Timeout, + Retries: cd.Spec.Service.Retries, + AppendHeaders: cd.Spec.Service.AppendHeaders, + Route: []istiov1alpha3.DestinationWeight{primary, canary}, }, }