apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: repositories.polling.tekton.dev
spec:
  group: polling.tekton.dev
  names:
    kind: Repository
    listKind: RepositoryList
    plural: repositories
    singular: repository
  scope: Namespaced
  versions:
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        description: Repository is the Schema for the repositories 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: RepositorySpec defines a repository to poll.
            properties:
              auth:
                description: AuthSecret references a secret for authenticating the
                  request.
                properties:
                  key:
                    type: string
                  secretRef:
                    description: SecretReference represents a Secret Reference. It
                      has enough information to retrieve secret in any namespace
                    properties:
                      name:
                        description: Name is unique within a namespace to reference
                          a secret resource.
                        type: string
                      namespace:
                        description: Namespace defines the space within which the
                          secret name must be unique.
                        type: string
                    type: object
                type: object
              frequency:
                type: string
              pipelineRef:
                description: PipelineRef links to the Pipeline to execute.
                properties:
                  name:
                    type: string
                  namespace:
                    type: string
                  params:
                    items:
                      properties:
                        expression:
                          type: string
                        name:
                          type: string
                      required:
                      - expression
                      - name
                      type: object
                    type: array
                  resources:
                    items:
                      description: PipelineResourceBinding connects a reference to
                        an instance of a PipelineResource with a PipelineResource
                        dependency that the Pipeline has declared
                      properties:
                        name:
                          description: Name is the name of the PipelineResource in
                            the Pipeline's declaration
                          type: string
                        resourceRef:
                          description: ResourceRef is a reference to the instance
                            of the actual PipelineResource that should be used
                          properties:
                            apiVersion:
                              description: API version of the referent
                              type: string
                            name:
                              description: 'Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names'
                              type: string
                          type: object
                        resourceSpec:
                          description: ResourceSpec is specification of a resource
                            that should be created and consumed by the task
                          properties:
                            description:
                              description: Description is a user-facing description
                                of the resource that may be used to populate a UI.
                              type: string
                            params:
                              items:
                                description: ResourceParam declares a string value
                                  to use for the parameter called Name, and is used
                                  in the specific context of PipelineResources.
                                properties:
                                  name:
                                    type: string
                                  value:
                                    type: string
                                required:
                                - name
                                - value
                                type: object
                              type: array
                            secrets:
                              description: Secrets to fetch to populate some of resource
                                fields
                              items:
                                description: SecretParam indicates which secret can
                                  be used to populate a field of the resource
                                properties:
                                  fieldName:
                                    type: string
                                  secretKey:
                                    type: string
                                  secretName:
                                    type: string
                                required:
                                - fieldName
                                - secretKey
                                - secretName
                                type: object
                              type: array
                            type:
                              type: string
                          required:
                          - params
                          - type
                          type: object
                      type: object
                    type: array
                  serviceAccountName:
                    type: string
                  workspaces:
                    items:
                      description: WorkspaceBinding maps a Task's declared workspace
                        to a Volume.
                      properties:
                        configMap:
                          description: ConfigMap represents a configMap that should
                            populate this workspace.
                          properties:
                            defaultMode:
                              description: 'Optional: mode bits to use on created
                                files by default. Must be a value between 0 and 0777.
                                Defaults to 0644. Directories within the path are
                                not affected by this setting. This might be in conflict
                                with other options that affect the file mode, like
                                fsGroup, and the result can be other mode bits set.'
                              format: int32
                              type: integer
                            items:
                              description: If unspecified, each key-value pair in
                                the Data field of the referenced ConfigMap will be
                                projected into the volume as a file whose name is
                                the key and content is the value. If specified, the
                                listed keys will be projected into the specified paths,
                                and unlisted keys will not be present. If a key is
                                specified which is not present in the ConfigMap, the
                                volume setup will error unless it is marked optional.
                                Paths must be relative and may not contain the '..'
                                path or start with '..'.
                              items:
                                description: Maps a string key to a path within a
                                  volume.
                                properties:
                                  key:
                                    description: The key to project.
                                    type: string
                                  mode:
                                    description: 'Optional: mode bits to use on this
                                      file, must be a value between 0 and 0777. If
                                      not specified, the volume defaultMode will be
                                      used. This might be in conflict with other options
                                      that affect the file mode, like fsGroup, and
                                      the result can be other mode bits set.'
                                    format: int32
                                    type: integer
                                  path:
                                    description: The relative path of the file to
                                      map the key to. May not be an absolute path.
                                      May not contain the path element '..'. May not
                                      start with the string '..'.
                                    type: string
                                required:
                                - key
                                - path
                                type: object
                              type: array
                            name:
                              description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
                                TODO: Add other useful fields. apiVersion, kind, uid?'
                              type: string
                            optional:
                              description: Specify whether the ConfigMap or its keys
                                must be defined
                              type: boolean
                          type: object
                        emptyDir:
                          description: 'EmptyDir represents a temporary directory
                            that shares a Task''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
                            Either this OR PersistentVolumeClaim can be used.'
                          properties:
                            medium:
                              description: 'What type of storage medium should back
                                this directory. The default is "" which means to use
                                the node''s default medium. Must be an empty string
                                (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
                              type: string
                            sizeLimit:
                              anyOf:
                              - type: integer
                              - type: string
                              description: 'Total amount of local storage required
                                for this EmptyDir volume. The size limit is also applicable
                                for memory medium. The maximum usage on memory medium
                                EmptyDir would be the minimum value between the SizeLimit
                                specified here and the sum of memory limits of all
                                containers in a pod. The default is nil which means
                                that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir'
                              pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                              x-kubernetes-int-or-string: true
                          type: object
                        name:
                          description: Name is the name of the workspace populated
                            by the volume.
                          type: string
                        persistentVolumeClaim:
                          description: PersistentVolumeClaimVolumeSource represents
                            a reference to a PersistentVolumeClaim in the same namespace.
                            Either this OR EmptyDir can be used.
                          properties:
                            claimName:
                              description: 'ClaimName is the name of a PersistentVolumeClaim
                                in the same namespace as the pod using this volume.
                                More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims'
                              type: string
                            readOnly:
                              description: Will force the ReadOnly setting in VolumeMounts.
                                Default false.
                              type: boolean
                          required:
                          - claimName
                          type: object
                        secret:
                          description: Secret represents a secret that should populate
                            this workspace.
                          properties:
                            defaultMode:
                              description: 'Optional: mode bits to use on created
                                files by default. Must be a value between 0 and 0777.
                                Defaults to 0644. Directories within the path are
                                not affected by this setting. This might be in conflict
                                with other options that affect the file mode, like
                                fsGroup, and the result can be other mode bits set.'
                              format: int32
                              type: integer
                            items:
                              description: If unspecified, each key-value pair in
                                the Data field of the referenced Secret will be projected
                                into the volume as a file whose name is the key and
                                content is the value. If specified, the listed keys
                                will be projected into the specified paths, and unlisted
                                keys will not be present. If a key is specified which
                                is not present in the Secret, the volume setup will
                                error unless it is marked optional. Paths must be
                                relative and may not contain the '..' path or start
                                with '..'.
                              items:
                                description: Maps a string key to a path within a
                                  volume.
                                properties:
                                  key:
                                    description: The key to project.
                                    type: string
                                  mode:
                                    description: 'Optional: mode bits to use on this
                                      file, must be a value between 0 and 0777. If
                                      not specified, the volume defaultMode will be
                                      used. This might be in conflict with other options
                                      that affect the file mode, like fsGroup, and
                                      the result can be other mode bits set.'
                                    format: int32
                                    type: integer
                                  path:
                                    description: The relative path of the file to
                                      map the key to. May not be an absolute path.
                                      May not contain the path element '..'. May not
                                      start with the string '..'.
                                    type: string
                                required:
                                - key
                                - path
                                type: object
                              type: array
                            optional:
                              description: Specify whether the Secret or its keys
                                must be defined
                              type: boolean
                            secretName:
                              description: 'Name of the secret in the pod''s namespace
                                to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret'
                              type: string
                          type: object
                        subPath:
                          description: SubPath is optionally a directory on the volume
                            which should be used for this binding (i.e. the volume
                            will be mounted at this sub directory).
                          type: string
                        volumeClaimTemplate:
                          description: VolumeClaimTemplate is a template for a claim
                            that will be created in the same namespace. The PipelineRun
                            controller is responsible for creating a unique claim
                            for each instance of PipelineRun.
                          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:
                              description: 'Standard object''s metadata. More info:
                                https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
                              type: object
                            spec:
                              description: 'Spec defines the desired characteristics
                                of a volume requested by a pod author. More info:
                                https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims'
                              properties:
                                accessModes:
                                  description: 'AccessModes contains the desired access
                                    modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1'
                                  items:
                                    type: string
                                  type: array
                                dataSource:
                                  description: This field requires the VolumeSnapshotDataSource
                                    alpha feature gate to be enabled and currently
                                    VolumeSnapshot is the only supported data source.
                                    If the provisioner can support VolumeSnapshot
                                    data source, it will create a new volume and data
                                    will be restored to the volume at the same time.
                                    If the provisioner does not support VolumeSnapshot
                                    data source, volume will not be created and the
                                    failure will be reported as an event. In the future,
                                    we plan to support more data source types and
                                    the behavior of the provisioner may change.
                                  properties:
                                    apiGroup:
                                      description: APIGroup is the group for the resource
                                        being referenced. If APIGroup is not specified,
                                        the specified Kind must be in the core API
                                        group. For any other third-party types, APIGroup
                                        is required.
                                      type: string
                                    kind:
                                      description: Kind is the type of resource being
                                        referenced
                                      type: string
                                    name:
                                      description: Name is the name of resource being
                                        referenced
                                      type: string
                                  required:
                                  - kind
                                  - name
                                  type: object
                                resources:
                                  description: 'Resources represents the minimum resources
                                    the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources'
                                  properties:
                                    limits:
                                      additionalProperties:
                                        anyOf:
                                        - type: integer
                                        - type: string
                                        pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                                        x-kubernetes-int-or-string: true
                                      description: 'Limits describes the maximum amount
                                        of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
                                      type: object
                                    requests:
                                      additionalProperties:
                                        anyOf:
                                        - type: integer
                                        - type: string
                                        pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                                        x-kubernetes-int-or-string: true
                                      description: 'Requests describes the minimum
                                        amount of compute resources required. If Requests
                                        is omitted for a container, it defaults to
                                        Limits if that is explicitly specified, otherwise
                                        to an implementation-defined value. More info:
                                        https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
                                      type: object
                                  type: object
                                selector:
                                  description: A label query over volumes to consider
                                    for binding.
                                  properties:
                                    matchExpressions:
                                      description: matchExpressions is a list of label
                                        selector requirements. The requirements are
                                        ANDed.
                                      items:
                                        description: A label selector requirement
                                          is a selector that contains values, a key,
                                          and an operator that relates the key and
                                          values.
                                        properties:
                                          key:
                                            description: key is the label key that
                                              the selector applies to.
                                            type: string
                                          operator:
                                            description: operator represents a key's
                                              relationship to a set of values. Valid
                                              operators are In, NotIn, Exists and
                                              DoesNotExist.
                                            type: string
                                          values:
                                            description: values is an array of string
                                              values. If the operator is In or NotIn,
                                              the values array must be non-empty.
                                              If the operator is Exists or DoesNotExist,
                                              the values array must be empty. This
                                              array is replaced during a strategic
                                              merge patch.
                                            items:
                                              type: string
                                            type: array
                                        required:
                                        - key
                                        - operator
                                        type: object
                                      type: array
                                    matchLabels:
                                      additionalProperties:
                                        type: string
                                      description: matchLabels is a map of {key,value}
                                        pairs. A single {key,value} in the matchLabels
                                        map is equivalent to an element of matchExpressions,
                                        whose key field is "key", the operator is
                                        "In", and the values array contains only "value".
                                        The requirements are ANDed.
                                      type: object
                                  type: object
                                storageClassName:
                                  description: 'Name of the StorageClass required
                                    by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1'
                                  type: string
                                volumeMode:
                                  description: volumeMode defines what type of volume
                                    is required by the claim. Value of Filesystem
                                    is implied when not included in claim spec. This
                                    is a beta feature.
                                  type: string
                                volumeName:
                                  description: VolumeName is the binding reference
                                    to the PersistentVolume backing this claim.
                                  type: string
                              type: object
                            status:
                              description: 'Status represents the current information/status
                                of a persistent volume claim. Read-only. More info:
                                https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims'
                              properties:
                                accessModes:
                                  description: 'AccessModes contains the actual access
                                    modes the volume backing the PVC has. More info:
                                    https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1'
                                  items:
                                    type: string
                                  type: array
                                capacity:
                                  additionalProperties:
                                    anyOf:
                                    - type: integer
                                    - type: string
                                    pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                                    x-kubernetes-int-or-string: true
                                  description: Represents the actual resources of
                                    the underlying volume.
                                  type: object
                                conditions:
                                  description: Current Condition of persistent volume
                                    claim. If underlying persistent volume is being
                                    resized then the Condition will be set to 'ResizeStarted'.
                                  items:
                                    description: PersistentVolumeClaimCondition contails
                                      details about state of pvc
                                    properties:
                                      lastProbeTime:
                                        description: Last time we probed the condition.
                                        format: date-time
                                        type: string
                                      lastTransitionTime:
                                        description: Last time the condition transitioned
                                          from one status to another.
                                        format: date-time
                                        type: string
                                      message:
                                        description: Human-readable message indicating
                                          details about last transition.
                                        type: string
                                      reason:
                                        description: Unique, this should be a short,
                                          machine understandable string that gives
                                          the reason for condition's last transition.
                                          If it reports "ResizeStarted" that means
                                          the underlying persistent volume is being
                                          resized.
                                        type: string
                                      status:
                                        type: string
                                      type:
                                        description: PersistentVolumeClaimConditionType
                                          is a valid value of PersistentVolumeClaimCondition.Type
                                        type: string
                                    required:
                                    - status
                                    - type
                                    type: object
                                  type: array
                                phase:
                                  description: Phase represents the current phase
                                    of PersistentVolumeClaim.
                                  type: string
                              type: object
                          type: object
                      required:
                      - name
                      type: object
                    type: array
                required:
                - name
                type: object
              ref:
                type: string
              type:
                description: RepoType defines the protocol to use to talk to the upstream
                  server.
                enum:
                - github
                - gitlab
                type: string
              url:
                type: string
            required:
            - pipelineRef
            - url
            type: object
          status:
            description: RepositoryStatus defines the observed state of Repository
            properties:
              lastError:
                type: string
              observedGeneration:
                format: int64
                type: integer
              pollStatus:
                description: PollStatus represents the last polled state of the repo.
                properties:
                  etag:
                    type: string
                  ref:
                    type: string
                  sha:
                    type: string
                required:
                - etag
                - ref
                - sha
                type: object
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
