From 663fa08cc16b4ab42a56983fa3fa63ca199042f3 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sat, 13 Apr 2019 21:21:51 +0300 Subject: [PATCH] Add hook type and status to CRD schema validation --- artifacts/flagger/crd.yaml | 35 ++++++++++++++++++++++++++++--- charts/flagger/templates/crd.yaml | 27 ++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/artifacts/flagger/crd.yaml b/artifacts/flagger/crd.yaml index c8817b80..134020e6 100644 --- a/artifacts/flagger/crd.yaml +++ b/artifacts/flagger/crd.yaml @@ -2,6 +2,8 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: canaries.flagger.app + annotations: + helm.sh/resource-policy: keep spec: group: flagger.app version: v1alpha3 @@ -39,9 +41,9 @@ spec: properties: spec: required: - - targetRef - - service - - canaryAnalysis + - targetRef + - service + - canaryAnalysis properties: progressDeadlineSeconds: type: number @@ -119,9 +121,36 @@ spec: properties: name: type: string + type: + type: string + enum: + - "" + - pre-rollout + - rollout + - post-rollout url: type: string format: url timeout: type: string pattern: "^[0-9]+(m|s)" + status: + properties: + phase: + type: string + enum: + - "" + - Initialized + - Progressing + - Succeeded + - Failed + canaryWeight: + type: number + failedChecks: + type: number + iterations: + type: number + lastAppliedSpec: + type: string + lastTransitionTime: + type: string diff --git a/charts/flagger/templates/crd.yaml b/charts/flagger/templates/crd.yaml index 1302acee..aad996b8 100644 --- a/charts/flagger/templates/crd.yaml +++ b/charts/flagger/templates/crd.yaml @@ -122,10 +122,37 @@ spec: properties: name: type: string + type: + type: string + enum: + - "" + - pre-rollout + - rollout + - post-rollout url: type: string format: url timeout: type: string pattern: "^[0-9]+(m|s)" + status: + properties: + phase: + type: string + enum: + - "" + - Initialized + - Progressing + - Succeeded + - Failed + canaryWeight: + type: number + failedChecks: + type: number + iterations: + type: number + lastAppliedSpec: + type: string + lastTransitionTime: + type: string {{- end }}