diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/crds/_all.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/crds/_all.yaml index 505d2a305..7630b552e 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/crds/_all.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/crds/_all.yaml @@ -11,6 +11,8 @@ {{- include "gitops-operator.crds.promotion-flow" $context }} --- {{- include "gitops-operator.crds.promotion-template" $context }} +--- + {{- include "gitops-operator.crds.product" $context }} --- {{- if not (get .Values.global "runtime").singleNamespace }} {{- include "gitops-operator.crds.restricted-gitsource" $context }} diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/crds/product.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/crds/product.yaml new file mode 100644 index 000000000..07bbf9bdf --- /dev/null +++ b/charts/gitops-runtime/templates/_components/gitops-operator/crds/product.yaml @@ -0,0 +1,264 @@ +{{- define "gitops-operator.crds.product" }} + {{- if .Values.crds.install }} +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: products.codefresh.io + annotations: + {{- if .Values.crds.keep }} + "helm.sh/resource-policy": keep + {{- end }} + {{- with .Values.crds.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + app.kubernetes.io/name: products.codefresh.io + app.kubernetes.io/part-of: gitops-operator + {{- with .Values.crds.additionalLabels }} + {{- toYaml . | nindent 4}} + {{- end }} +spec: + group: codefresh.io + names: + kind: Product + listKind: ProductList + plural: products + shortNames: + - prod + singular: product + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: Product is the Schema for the products API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: ProductSpec defines the desired state of Product + properties: + promotionFlows: + description: PromotionFlows is an array of promotion flows and their + relevant matchers. + items: + description: ProductPromotionFlowsSelectors defines all selectors + to use one specific PromotionFlow + properties: + gitTriggerSelectors: + description: List of selectors based on git trigger info + items: + description: Selector based on git trigger info + properties: + key: + description: Key field to use for the expression + enum: + - commitMessage + - gitRevision + type: string + operator: + description: Operator used for filtering 'key' value + enum: + - In + - NotIn + type: string + values: + description: Filter values for operator + items: + type: string + minItems: 1 + type: array + required: + - key + - operator + - values + type: object + minItems: 1 + type: array + name: + description: Promotion flow name + type: string + required: + - name + type: object + minItems: 1 + type: array + promotionTemplate: + description: PromotionTemplate is used to define a custom template + for the product + properties: + promotion: + additionalProperties: + properties: + jsonPaths: + description: JsonPaths is an array of json paths inside + the file, + items: + type: string + minItems: 1 + type: array + required: + - jsonPaths + type: object + description: Promotion is the definition on how to promote this + application + type: object + versionSource: + description: VersionSource is the source of the application version + properties: + file: + description: File is the file name of the source + type: string + jsonPath: + description: JsonPath is the json path inside the file, to + the version information + type: string + required: + - file + - jsonPath + type: object + type: object + promotionTemplateRef: + description: PromotionTemplateRef is the name of associated promotion + template + type: string + type: object + type: object + served: true + storage: false + - name: v1beta2 + schema: + openAPIV3Schema: + description: Product is the Schema for the products API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: ProductSpec defines the desired state of Product + properties: + concurrency: + description: Concurrency specifies policy used for concurrent promotions + enum: + - queue + - terminate + type: string + promotionFlows: + description: PromotionFlows is an array of promotion flows and their + relevant matchers. + items: + description: ProductPromotionFlowsSelectors defines all selectors + to use one specific PromotionFlow + properties: + gitTriggerSelectors: + description: List of selectors based on git trigger info + items: + description: Selector based on git trigger info + properties: + key: + description: Key field to use for the expression + enum: + - commitMessage + - gitRevision + type: string + operator: + description: Operator used for filtering 'key' value + enum: + - In + - NotIn + type: string + values: + description: Filter values for operator + items: + type: string + minItems: 1 + type: array + required: + - key + - operator + - values + type: object + minItems: 1 + type: array + name: + description: Promotion flow name + type: string + required: + - name + type: object + minItems: 1 + type: array + promotionTemplate: + description: PromotionTemplate is used to define a custom template + for the product + properties: + promotion: + additionalProperties: + properties: + jsonPaths: + description: JsonPaths is an array of json paths inside + the file, + items: + type: string + minItems: 1 + type: array + required: + - jsonPaths + type: object + description: Promotion is the definition on how to promote this + application + type: object + versionSource: + description: VersionSource is the source of the application version + properties: + file: + description: File is the file name of the source + type: string + jsonPath: + description: JsonPath is the json path inside the file, to + the version information + type: string + required: + - file + - jsonPath + type: object + type: object + promotionTemplateRef: + description: PromotionTemplateRef is the name of associated promotion + template + type: string + type: object + type: object + served: true + storage: true + {{- end }} +{{- end }}