{{- if .Values.zfsLocalPv.enabled -}}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.19.0
    {{- include "crds.extraAnnotations" .Values.zfsLocalPv | nindent 4 }}
  name: zfsnodes.zfs.openebs.io
spec:
  group: zfs.openebs.io
  names:
    kind: ZFSNode
    listKind: ZFSNodeList
    plural: zfsnodes
    shortNames:
    - zfsnode
    singular: zfsnode
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: |-
          ZFSNode records information about all zfs pools available
          in a node. In general, the openebs node-agent creates the ZFSNode
          object & periodically synchronizing the zfs pools available in the node.
          ZFSNode has an owner reference pointing to the corresponding node object.
        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
          pools:
            items:
              description: Pool specifies attributes of a given zfs pool that exists
                on the node.
              properties:
                free:
                  anyOf:
                  - type: integer
                  - type: string
                  description: Free specifies the available capacity of zfs pool.
                  pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                  x-kubernetes-int-or-string: true
                name:
                  description: Name of the zfs pool.
                  minLength: 1
                  type: string
                used:
                  anyOf:
                  - type: integer
                  - type: string
                  description: Used specifies the used capacity of zfs pool.
                  pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                  x-kubernetes-int-or-string: true
                uuid:
                  description: UUID denotes a unique identity of a zfs pool.
                  minLength: 1
                  type: string
              required:
              - free
              - name
              - used
              - uuid
              type: object
            type: array
        required:
        - pools
        type: object
    served: true
    storage: true
{{- end -}}
