From 3684ca676726e71e38f5613bd2cbe244d6476b83 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Mon, 16 Dec 2024 11:20:50 +0900 Subject: [PATCH] s Signed-off-by: kahirokunn --- artifacts/flagger/crd.yaml | 72 ++++++++++++++++++++------------- charts/flagger/crds/crd.yaml | 72 ++++++++++++++++++++------------- kustomize/base/flagger/crd.yaml | 72 ++++++++++++++++++++------------- 3 files changed, 129 insertions(+), 87 deletions(-) diff --git a/artifacts/flagger/crd.yaml b/artifacts/flagger/crd.yaml index 1f2bb46f9..cac089c82 100644 --- a/artifacts/flagger/crd.yaml +++ b/artifacts/flagger/crd.yaml @@ -526,6 +526,10 @@ spec: required: - name type: object + x-kubernetes-validations: + - message: Must have port for Service reference + rule: '(size(self.group) == 0 && self.kind == ''Service'') + ? has(self.port) : true' required: - backendRef headers: @@ -891,7 +895,7 @@ spec: type: object additionalProperties: type: string - backendRef: &backendRef + backend: &backend type: object properties: filters: @@ -1006,6 +1010,11 @@ spec: required: - name type: object + x-kubernetes-validations: + - message: Must have port for Service reference + rule: + "(size(self.group) == 0 && self.kind + == 'Service') ? has(self.port) : true" required: - backendRef type: object @@ -1281,35 +1290,40 @@ spec: self.filter(f, f.type == 'URLRewrite').size() <= 1 ref: - group: - default: "" - maxLength: 253 - pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - type: string - kind: - default: Service - maxLength: 63 - minLength: 1 - pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ - type: string - name: - description: Name is the name of the referent. - maxLength: 253 - minLength: 1 - type: string - namespace: - maxLength: 63 - minLength: 1 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ - type: string - port: - format: int32 - maximum: 65535 - minimum: 1 - type: integer + type: object + properties: + group: + default: "" + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + kind: + default: Service + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + name: + description: Name is the name of the referent. + maxLength: 253 + minLength: 1 + type: string + namespace: + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + port: + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - name - type: object + x-kubernetes-validations: + - message: Must have port for Service reference + rule: '(size(self.group) == 0 && self.kind == ''Service'') + ? has(self.port) : true' canary: description: Metadata to add to the canary service type: object @@ -1322,7 +1336,7 @@ spec: type: object additionalProperties: type: string - backendRef: *backendRef + backend: *backend skipAnalysis: description: Skip analysis and promote canary type: boolean diff --git a/charts/flagger/crds/crd.yaml b/charts/flagger/crds/crd.yaml index 1f2bb46f9..cac089c82 100644 --- a/charts/flagger/crds/crd.yaml +++ b/charts/flagger/crds/crd.yaml @@ -526,6 +526,10 @@ spec: required: - name type: object + x-kubernetes-validations: + - message: Must have port for Service reference + rule: '(size(self.group) == 0 && self.kind == ''Service'') + ? has(self.port) : true' required: - backendRef headers: @@ -891,7 +895,7 @@ spec: type: object additionalProperties: type: string - backendRef: &backendRef + backend: &backend type: object properties: filters: @@ -1006,6 +1010,11 @@ spec: required: - name type: object + x-kubernetes-validations: + - message: Must have port for Service reference + rule: + "(size(self.group) == 0 && self.kind + == 'Service') ? has(self.port) : true" required: - backendRef type: object @@ -1281,35 +1290,40 @@ spec: self.filter(f, f.type == 'URLRewrite').size() <= 1 ref: - group: - default: "" - maxLength: 253 - pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - type: string - kind: - default: Service - maxLength: 63 - minLength: 1 - pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ - type: string - name: - description: Name is the name of the referent. - maxLength: 253 - minLength: 1 - type: string - namespace: - maxLength: 63 - minLength: 1 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ - type: string - port: - format: int32 - maximum: 65535 - minimum: 1 - type: integer + type: object + properties: + group: + default: "" + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + kind: + default: Service + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + name: + description: Name is the name of the referent. + maxLength: 253 + minLength: 1 + type: string + namespace: + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + port: + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - name - type: object + x-kubernetes-validations: + - message: Must have port for Service reference + rule: '(size(self.group) == 0 && self.kind == ''Service'') + ? has(self.port) : true' canary: description: Metadata to add to the canary service type: object @@ -1322,7 +1336,7 @@ spec: type: object additionalProperties: type: string - backendRef: *backendRef + backend: *backend skipAnalysis: description: Skip analysis and promote canary type: boolean diff --git a/kustomize/base/flagger/crd.yaml b/kustomize/base/flagger/crd.yaml index 1f2bb46f9..cac089c82 100644 --- a/kustomize/base/flagger/crd.yaml +++ b/kustomize/base/flagger/crd.yaml @@ -526,6 +526,10 @@ spec: required: - name type: object + x-kubernetes-validations: + - message: Must have port for Service reference + rule: '(size(self.group) == 0 && self.kind == ''Service'') + ? has(self.port) : true' required: - backendRef headers: @@ -891,7 +895,7 @@ spec: type: object additionalProperties: type: string - backendRef: &backendRef + backend: &backend type: object properties: filters: @@ -1006,6 +1010,11 @@ spec: required: - name type: object + x-kubernetes-validations: + - message: Must have port for Service reference + rule: + "(size(self.group) == 0 && self.kind + == 'Service') ? has(self.port) : true" required: - backendRef type: object @@ -1281,35 +1290,40 @@ spec: self.filter(f, f.type == 'URLRewrite').size() <= 1 ref: - group: - default: "" - maxLength: 253 - pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - type: string - kind: - default: Service - maxLength: 63 - minLength: 1 - pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ - type: string - name: - description: Name is the name of the referent. - maxLength: 253 - minLength: 1 - type: string - namespace: - maxLength: 63 - minLength: 1 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ - type: string - port: - format: int32 - maximum: 65535 - minimum: 1 - type: integer + type: object + properties: + group: + default: "" + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + kind: + default: Service + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + name: + description: Name is the name of the referent. + maxLength: 253 + minLength: 1 + type: string + namespace: + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + port: + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - name - type: object + x-kubernetes-validations: + - message: Must have port for Service reference + rule: '(size(self.group) == 0 && self.kind == ''Service'') + ? has(self.port) : true' canary: description: Metadata to add to the canary service type: object @@ -1322,7 +1336,7 @@ spec: type: object additionalProperties: type: string - backendRef: *backendRef + backend: *backend skipAnalysis: description: Skip analysis and promote canary type: boolean