#/*
# * Copyright (C) 2020 Intel Corporation
# * SPDX-License-Identifier: BSD-3-Clause
# */

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  # name must match the spec fields below, and be in the form: <plural>.<group>
  name: hostattributes.crd.isecl.intel.com
spec:
  # group name to use for REST API: /apis/<group>/<version>
  group: crd.isecl.intel.com
  # list of versions supported by this CustomResourceDefinition
  versions:
    - name: v1beta1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                hostList:
                  type: array
                  items:
                    type: object
                    properties:
                      updatedTime:
                        type: string
                      hostName:
                        type: string
                      trusted:
                        type: boolean
                      hvsSignedTrustReport:
                        type: string
                      hvsTrustValidTo:
                        type: string
                      assetTags:
                        type: object
                        additionalProperties:
                          type: string
                      hardwareFeatures:
                        type: object
                        additionalProperties:
                          type: string
                      # SKC Attributes
                      sgxSignedTrustReport:
                        type: string
                      sgxTrustValidTo:
                        type: string
                      sgxEnabled:
                        type: string
                      sgxSupported:
                        type: string
                      tcbUpToDate:
                        type: string
                      epcSize:
                        type: string
                      flcEnabled:
                        type: string
  # either Namespaced or Cluster
  scope: Namespaced
  names:
    # plural name to be used in the URL: /apis/<group>/<version>/<plural>
    plural: hostattributes
    # singular name to be used as an alias on the CLI and for display
    singular: hostattribute
    # kind is normally the CamelCased singular type. Your resource manifests use this.
    kind: HostAttributesCrd
    # shortNames allow shorter string to match your resource on the CLI
    shortNames:
      - ha

