From c6e96ff1bbf409a6f7424ec9f991bbb83cbe488b Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sat, 2 Mar 2019 13:33:03 +0200 Subject: [PATCH] Add append headers field to Canary CRD --- pkg/apis/flagger/v1alpha3/types.go | 15 ++++++++------- .../flagger/v1alpha3/zz_generated.deepcopy.go | 7 +++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pkg/apis/flagger/v1alpha3/types.go b/pkg/apis/flagger/v1alpha3/types.go index 0690695c..ae74f273 100755 --- a/pkg/apis/flagger/v1alpha3/types.go +++ b/pkg/apis/flagger/v1alpha3/types.go @@ -109,13 +109,14 @@ type CanaryStatus struct { // CanaryService is used to create ClusterIP services // and Istio Virtual Service type CanaryService struct { - Port int32 `json:"port"` - Gateways []string `json:"gateways"` - Hosts []string `json:"hosts"` - Match []istiov1alpha3.HTTPMatchRequest `json:"match,omitempty"` - Rewrite *istiov1alpha3.HTTPRewrite `json:"rewrite,omitempty"` - Timeout string `json:"timeout,omitempty"` - Retries *istiov1alpha3.HTTPRetry `json:"retries,omitempty"` + Port int32 `json:"port"` + Gateways []string `json:"gateways"` + Hosts []string `json:"hosts"` + Match []istiov1alpha3.HTTPMatchRequest `json:"match,omitempty"` + Rewrite *istiov1alpha3.HTTPRewrite `json:"rewrite,omitempty"` + Timeout string `json:"timeout,omitempty"` + Retries *istiov1alpha3.HTTPRetry `json:"retries,omitempty"` + AppendHeaders map[string]string `json:"appendHeaders,omitempty"` } // CanaryAnalysis is used to describe how the analysis should be done diff --git a/pkg/apis/flagger/v1alpha3/zz_generated.deepcopy.go b/pkg/apis/flagger/v1alpha3/zz_generated.deepcopy.go index bded64e4..baf35439 100644 --- a/pkg/apis/flagger/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/apis/flagger/v1alpha3/zz_generated.deepcopy.go @@ -161,6 +161,13 @@ func (in *CanaryService) DeepCopyInto(out *CanaryService) { *out = new(istiov1alpha3.HTTPRetry) **out = **in } + if in.AppendHeaders != nil { + in, out := &in.AppendHeaders, &out.AppendHeaders + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } return }