From d148933ab3ff41d9161b22458e0881cc26382437 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Wed, 27 Feb 2019 15:46:09 +0200 Subject: [PATCH] Add metric query field to Canary CRD --- artifacts/flagger/crd.yaml | 2 ++ charts/flagger/templates/crd.yaml | 2 ++ pkg/apis/flagger/v1alpha3/types.go | 8 +++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/artifacts/flagger/crd.yaml b/artifacts/flagger/crd.yaml index a38c927d..106cb1ff 100644 --- a/artifacts/flagger/crd.yaml +++ b/artifacts/flagger/crd.yaml @@ -100,6 +100,8 @@ spec: pattern: "^[0-9]+(m|s)" threshold: type: number + query: + type: string webhooks: type: array properties: diff --git a/charts/flagger/templates/crd.yaml b/charts/flagger/templates/crd.yaml index 4d9527f7..0fd89e01 100644 --- a/charts/flagger/templates/crd.yaml +++ b/charts/flagger/templates/crd.yaml @@ -101,6 +101,8 @@ spec: pattern: "^[0-9]+(m|s)" threshold: type: number + query: + type: string webhooks: type: array properties: diff --git a/pkg/apis/flagger/v1alpha3/types.go b/pkg/apis/flagger/v1alpha3/types.go index 628c5dda..5829e954 100755 --- a/pkg/apis/flagger/v1alpha3/types.go +++ b/pkg/apis/flagger/v1alpha3/types.go @@ -127,9 +127,11 @@ type CanaryAnalysis struct { // CanaryMetric holds the reference to Istio metrics used for canary analysis type CanaryMetric struct { - Name string `json:"name"` - Interval string `json:"interval"` - Threshold int `json:"threshold"` + Name string `json:"name"` + Interval string `json:"interval"` + Threshold float64 `json:"threshold"` + // +optional + Query string `json:"query,omitempty"` } // CanaryWebhook holds the reference to external checks used for canary analysis