cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/txtar/crd_simple.txtar (about)

     1  #version: k8sCRD
     2  
     3  -- schema.yaml --
     4  apiVersion: apiextensions.k8s.io/v1
     5  kind: CustomResourceDefinition
     6  metadata:
     7    # name must be in the form: <plural>.<group>
     8    name: myapps.example.com
     9  spec:
    10    # group name to use for REST API: /apis/<group>/<version>
    11    group: example.com
    12    scope: Namespaced
    13    names:
    14      # kind is normally the CamelCased singular type.
    15      kind: MyApp
    16      # singular name to be used as an alias on the CLI
    17      singular: myapp
    18      # plural name in the URL: /apis/<group>/<version>/<plural>
    19      plural: myapps
    20    versions:
    21    - name: v1
    22      served: true
    23      storage: true
    24      schema:
    25        openAPIV3Schema:
    26          type: object
    27          properties:
    28            spec:
    29              type: object
    30              x-kubernetes-preserve-unknown-fields: true
    31            intField:
    32              type: number
    33              format: uint32
    34  
    35  -- out/decode/extract --
    36  _embeddedResource
    37  spec?: {
    38  	...
    39  }
    40  intField?: uint32
    41  
    42  _embeddedResource: {
    43  	apiVersion!: string
    44  	kind!:       string
    45  	metadata?: {
    46  		...
    47  	}
    48  }