---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.15.0
  name: codebasebranches.v2.edp.epam.com
spec:
  group: v2.edp.epam.com
  names:
    kind: CodebaseBranch
    listKind: CodebaseBranchList
    plural: codebasebranches
    shortNames:
    - cb
    singular: codebasebranch
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: Result of last action
      jsonPath: .status.result
      name: Result
      type: string
    - description: The status of codebasebranch
      jsonPath: .status.status
      name: Status
      type: string
    - description: Owner of object
      jsonPath: .spec.codebaseName
      name: Codebase Name
      type: string
    - description: Is a release branch
      jsonPath: .spec.release
      name: Release
      type: boolean
    name: v1
    schema:
      openAPIV3Schema:
        description: CodebaseBranch is the Schema for the CodebaseBranches 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: CodebaseBranchSpec defines the desired state of CodebaseBranch.
            properties:
              branchName:
                description: Name of a branch.
                type: string
              codebaseName:
                description: Name of Codebase associated with.
                type: string
              fromCommit:
                description: The new branch will be created starting from the selected
                  commit hash.
                type: string
              pipelines:
                additionalProperties:
                  type: string
                description: Pipelines is a map of pipelines related to the branch.
                example:
                  build: build-pipeline
                  review: review-pipeline
                nullable: true
                type: object
              release:
                description: Flag if branch is used as "release" branch.
                type: boolean
              version:
                nullable: true
                type: string
            required:
            - branchName
            - codebaseName
            - fromCommit
            - release
            type: object
          status:
            description: CodebaseBranchStatus defines the observed state of CodebaseBranch.
            properties:
              action:
                description: The last Action was performed.
                type: string
              build:
                nullable: true
                type: string
              detailedMessage:
                description: |-
                  Detailed information regarding action result
                  which were performed
                type: string
              failureCount:
                description: Amount of times, operator fail to serve with existing
                  CR.
                format: int64
                type: integer
              git:
                description: Specifies a status of action for git.
                type: string
              lastSuccessfulBuild:
                nullable: true
                type: string
              lastTimeUpdated:
                description: Information when the last time the action were performed.
                format: date-time
                type: string
              result:
                description: |-
                  A result of an action which were performed.
                  - "success": action where performed successfully;
                  - "error": error has occurred;
                enum:
                - success
                - error
                type: string
              status:
                description: Specifies a current status of CodebaseBranch.
                type: string
              username:
                description: Name of user who made a last change.
                type: string
              value:
                description: Specifies a current state of CodebaseBranch.
                type: string
              versionHistory:
                items:
                  type: string
                nullable: true
                type: array
            required:
            - action
            - failureCount
            - lastTimeUpdated
            - result
            - status
            - username
            - value
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
