159 lines
6 KiB
YAML
159 lines
6 KiB
YAML
apiVersion: apiextensions.k8s.io/v1
|
|
kind: CustomResourceDefinition
|
|
metadata:
|
|
name: projectdeliveries.delivery.quorate.dev
|
|
spec:
|
|
group: delivery.quorate.dev
|
|
names:
|
|
kind: ProjectDelivery
|
|
listKind: ProjectDeliveryList
|
|
plural: projectdeliveries
|
|
singular: projectdelivery
|
|
scope: Namespaced
|
|
versions:
|
|
- name: v1alpha1
|
|
served: true
|
|
storage: true
|
|
subresources:
|
|
status: {}
|
|
schema:
|
|
openAPIV3Schema:
|
|
type: object
|
|
required: [spec]
|
|
properties:
|
|
apiVersion:
|
|
type: string
|
|
kind:
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
spec:
|
|
type: object
|
|
required: [source, targets, workflowTemplateRef]
|
|
properties:
|
|
source:
|
|
type: object
|
|
required: [repository]
|
|
properties:
|
|
repository:
|
|
type: string
|
|
pattern: '^https://[^/?#@[:space:]]+/[^/?#[:space:]]+/[^/?#[:space:]]+/?$'
|
|
continuous:
|
|
type: object
|
|
required: [ref]
|
|
properties:
|
|
ref:
|
|
type: string
|
|
pattern: '^refs/[^\x00-\x20\x7f~^:?*\[\\]+$'
|
|
debounce:
|
|
type: string
|
|
paths:
|
|
type: array
|
|
minItems: 1
|
|
x-kubernetes-list-type: set
|
|
items:
|
|
type: string
|
|
minLength: 1
|
|
pattern: '^[^/]+(/[^/]+)*$'
|
|
x-kubernetes-validations:
|
|
- rule: "!has(self.debounce) || duration(self.debounce) > duration('0s')"
|
|
message: debounce must be a positive duration
|
|
- rule: "!self.ref.contains('..') && !self.ref.contains('//') && !self.ref.contains('@{') && !self.ref.endsWith('/') && !self.ref.endsWith('.') && !self.ref.matches('(^|/)[.]') && !self.ref.matches('(^|/)[^/]*[.]lock(/|$)')"
|
|
message: ref must satisfy git-check-ref-format
|
|
point:
|
|
type: object
|
|
required: [revisions]
|
|
properties:
|
|
revisions:
|
|
type: array
|
|
minItems: 1
|
|
x-kubernetes-list-type: set
|
|
items:
|
|
type: string
|
|
pattern: ^([0-9a-f]{40}|[0-9a-f]{64})$
|
|
x-kubernetes-validations:
|
|
- rule: has(self.continuous) != has(self.point)
|
|
message: source must contain exactly one delivery mode
|
|
targets:
|
|
type: array
|
|
minItems: 1
|
|
x-kubernetes-list-type: atomic
|
|
items:
|
|
type: object
|
|
x-kubernetes-map-type: atomic
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
workflowTemplateRef:
|
|
type: object
|
|
required: [name]
|
|
properties:
|
|
name:
|
|
type: string
|
|
maxLength: 253
|
|
pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$'
|
|
qualification:
|
|
type: object
|
|
required: [workflowTemplateRef]
|
|
properties:
|
|
workflowTemplateRef:
|
|
type: object
|
|
required: [name]
|
|
properties:
|
|
name:
|
|
type: string
|
|
maxLength: 253
|
|
pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$'
|
|
mode:
|
|
type: string
|
|
enum: [OnBuild, ManualOnly]
|
|
default: ManualOnly
|
|
interval:
|
|
type: string
|
|
default: 0s
|
|
x-kubernetes-validations:
|
|
- rule: "duration(self.interval) >= duration('0s')"
|
|
message: interval must be a non-negative duration
|
|
status:
|
|
type: object
|
|
properties:
|
|
observedGeneration:
|
|
type: integer
|
|
format: int64
|
|
message:
|
|
type: string
|
|
lastHandledRetry:
|
|
type: string
|
|
maxLength: 253
|
|
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
|
|
continuous:
|
|
type: object
|
|
properties:
|
|
candidateRevision:
|
|
type: string
|
|
candidateIdentity:
|
|
type: string
|
|
candidateBuckets:
|
|
type: array
|
|
maxItems: 3
|
|
items:
|
|
type: string
|
|
candidateSince:
|
|
type: string
|
|
format: date-time
|
|
attempt:
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
delivered:
|
|
type: object
|
|
required: [revision, identity]
|
|
properties:
|
|
revision:
|
|
type: string
|
|
identity:
|
|
type: string
|
|
qualification:
|
|
type: object
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
points:
|
|
type: array
|
|
items:
|
|
type: object
|
|
x-kubernetes-preserve-unknown-fields: true
|