From 62b906d30b5c16eb0371ebadf4a749120b7fff2f Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Fri, 8 Mar 2019 11:49:32 +0200 Subject: [PATCH] Add canary HTTP match conditions and iterations --- pkg/apis/flagger/v1alpha3/types.go | 15 +++++++++------ .../flagger/v1alpha3/zz_generated.deepcopy.go | 7 +++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pkg/apis/flagger/v1alpha3/types.go b/pkg/apis/flagger/v1alpha3/types.go index 05dece8c..cf43691d 100755 --- a/pkg/apis/flagger/v1alpha3/types.go +++ b/pkg/apis/flagger/v1alpha3/types.go @@ -98,6 +98,7 @@ type CanaryStatus struct { Phase CanaryPhase `json:"phase"` FailedChecks int `json:"failedChecks"` CanaryWeight int `json:"canaryWeight"` + Iterations int `json:"iterations"` // +optional TrackedConfigs *map[string]string `json:"trackedConfigs,omitempty"` // +optional @@ -122,12 +123,14 @@ type CanaryService struct { // CanaryAnalysis is used to describe how the analysis should be done type CanaryAnalysis struct { - Interval string `json:"interval"` - Threshold int `json:"threshold"` - MaxWeight int `json:"maxWeight"` - StepWeight int `json:"stepWeight"` - Metrics []CanaryMetric `json:"metrics"` - Webhooks []CanaryWebhook `json:"webhooks,omitempty"` + Interval string `json:"interval"` + Threshold int `json:"threshold"` + MaxWeight int `json:"maxWeight"` + StepWeight int `json:"stepWeight"` + Metrics []CanaryMetric `json:"metrics"` + Webhooks []CanaryWebhook `json:"webhooks,omitempty"` + Match []istiov1alpha3.HTTPMatchRequest `json:"match,omitempty"` + Iterations int `json:"iterations,omitempty"` } // CanaryMetric holds the reference to Istio metrics used for canary analysis diff --git a/pkg/apis/flagger/v1alpha3/zz_generated.deepcopy.go b/pkg/apis/flagger/v1alpha3/zz_generated.deepcopy.go index 638a9457..7567dff0 100644 --- a/pkg/apis/flagger/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/apis/flagger/v1alpha3/zz_generated.deepcopy.go @@ -69,6 +69,13 @@ func (in *CanaryAnalysis) DeepCopyInto(out *CanaryAnalysis) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Match != nil { + in, out := &in.Match, &out.Match + *out = make([]istiov1alpha3.HTTPMatchRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return }