apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    api-approved.openshift.io: https://github.com/openshift/api/pull/481
    description: Extension for configuring openshift web console YAML samples.
    displayName: ConsoleYAMLSample
    include.release.openshift.io/ibm-cloud-managed: "true"
    include.release.openshift.io/self-managed-high-availability: "true"
    include.release.openshift.io/single-node-developer: "true"
  name: consoleyamlsamples.console.openshift.io
spec:
  group: console.openshift.io
  names:
    kind: ConsoleYAMLSample
    listKind: ConsoleYAMLSampleList
    plural: consoleyamlsamples
    singular: consoleyamlsample
  scope: Cluster
  versions:
    - name: v1
      schema:
        openAPIV3Schema:
          description: ConsoleYAMLSample is an extension for customizing OpenShift web console YAML samples.
          type: object
          required:
            - metadata
            - spec
          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: ConsoleYAMLSampleSpec is the desired YAML sample configuration. Samples will appear with their descriptions in a samples sidebar when creating a resources in the web console.
              type: object
              required:
                - description
                - targetResource
                - title
                - yaml
              properties:
                description:
                  description: description of the YAML sample.
                  type: string
                  pattern: ^(.|\s)*\S(.|\s)*$
                snippet:
                  description: snippet indicates that the YAML sample is not the full YAML resource definition, but a fragment that can be inserted into the existing YAML document at the user's cursor.
                  type: boolean
                targetResource:
                  description: targetResource contains apiVersion and kind of the resource YAML sample is representating.
                  type: 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
                title:
                  description: title of the YAML sample.
                  type: string
                  pattern: ^(.|\s)*\S(.|\s)*$
                yaml:
                  description: yaml is the YAML sample to display.
                  type: string
                  pattern: ^(.|\s)*\S(.|\s)*$
      served: true
      storage: true
