cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/txtar/crd_intorstring.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              x-kubernetes-int-or-string: true
    30  
    31  -- out/decode/extract --
    32  _embeddedResource
    33  spec?: int | string
    34  
    35  _embeddedResource: {
    36  	apiVersion!: string
    37  	kind!:       string
    38  	metadata?: {
    39  		...
    40  	}
    41  }