---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    config.couchbase.com/version: 2.3.0
    controller-gen.kubebuilder.io/version: v0.8.0
  name: couchbasescopes.couchbase.com
spec:
  group: couchbase.com
  names:
    kind: CouchbaseScope
    listKind: CouchbaseScopeList
    plural: couchbasescopes
    singular: couchbasescope
  scope: Namespaced
  versions:
  - name: v2
    schema:
      openAPIV3Schema:
        description: CouchbaseScope represents a logical unit of data storage that
          sits between buckets and collections e.g. a bucket may contain multiple
          scopes, and a scope may contain multiple collections.  At present, scopes
          are not nested, so provide only a single level of abstraction.  Scopes provide
          a coarser grained basis for role-based access control (RBAC) and cross-datacenter
          replication (XDCR) than collections, but finer that buckets. In order to
          be considered by the Operator, a scope must be referenced by either a `CouchbaseBucket`
          or `CouchbaseEphemeralBucket` resource.
        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:
            default: {}
            description: Spec defines the desired state of the resource.
            properties:
              collections:
                description: Collections defines how to collate collections included
                  in this scope or scope group. Any of the provided methods may be
                  used to collate a set of collections to manage.  Collated collections
                  must have unique names, otherwise it is considered ambiguous, and
                  an error condition.
                properties:
                  managed:
                    description: Managed indicates whether collections within this
                      scope are managed. If not then you can dynamically create and
                      delete collections with the Couchbase UI or SDKs.
                    type: boolean
                  preserveDefaultCollection:
                    description: PreserveDefaultCollection indicates whether the Operator
                      should manage the default collection within the default scope.  The
                      default collection can be deleted, but can not be recreated
                      by Couchbase Server.  By setting this field to `true`, the Operator
                      will implicitly manage the default collection within the default
                      scope.  The default collection cannot be modified and will have
                      no document time-to-live (TTL).  When set to `false`, the operator
                      will not manage the default collection, which will be deleted
                      and cannot be used or recreated.
                    type: boolean
                  resources:
                    description: Resources is an explicit list of named resources
                      that will be considered for inclusion in this scope or scopes.  If
                      a resource reference doesn't match a resource, then no error
                      conditions are raised due to undefined resource creation ordering
                      and eventual consistency.
                    items:
                      properties:
                        kind:
                          default: CouchbaseCollection
                          description: Kind indicates the kind of resource that is
                            being referenced.  A scope can only reference `CouchbaseCollection`
                            and `CouchbaseCollectionGroup` resource kinds.  This field
                            defaults to `CouchbaseCollection` if not specified.
                          enum:
                          - CouchbaseCollection
                          - CouchbaseCollectionGroup
                          type: string
                        name:
                          description: Name is the name of the Kubernetes resource
                            name that is being referenced. Legal collection names
                            have a maximum length of 251 characters and may be composed
                            of any character from "a-z", "A-Z", "0-9" and "_-%".
                          maxLength: 251
                          minLength: 1
                          pattern: ^[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,250}$
                          type: string
                      required:
                      - name
                      type: object
                    type: array
                  selector:
                    description: 'Selector allows resources to be implicitly considered
                      for inclusion in this scope or scopes.  More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#labelselector-v1-meta'
                    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
                type: object
              defaultScope:
                description: DefaultScope indicates whether this resource represents
                  the default scope for a bucket.  When set to `true`, this allows
                  the user to refer to and manage collections within the default scope.  When
                  not defined, the Operator will implicitly manage the default scope
                  as the default scope can not be deleted from Couchbase Server.  The
                  Operator defined default scope will also have the `persistDefaultCollection`
                  flag set to `true`.  Only one default scope is permitted to be contained
                  in a bucket.
                type: boolean
              name:
                description: Name specifies the name of the scope.  By default, the
                  metadata.name is used to define the scope name, however, due to
                  the limited character set, this field can be used to override the
                  default and provide the full functionality. Additionally the `metadata.name`
                  field is a DNS label, and thus limited to 63 characters, this field
                  must be used if the name is longer than this limit. Scope names
                  must be 1-251 characters in length, contain only [a-zA-Z0-9_-%]
                  and not start with either _ or %.
                maxLength: 251
                minLength: 1
                pattern: ^[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,250}$
                type: string
            type: object
        type: object
    served: true
    storage: true
