github.com/oam-dev/kubevela@v1.9.11/charts/vela-core/templates/defwithtemplate/configmap.yaml (about)

     1  # Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
     2  # Definition source cue file: vela-templates/definitions/deprecated/configmap.cue
     3  apiVersion: core.oam.dev/v1beta1
     4  kind: TraitDefinition
     5  metadata:
     6    annotations:
     7      definition.oam.dev/description: Create/Attach configmaps on K8s pod for your workload which follows the pod spec in path 'spec.template'. This definition is DEPRECATED, please specify configmap in 'storage' instead.
     8    labels:
     9      custom.definition.oam.dev/deprecated: "true"
    10    name: configmap
    11    namespace: {{ include "systemDefinitionNamespace" . }}
    12  spec:
    13    appliesToWorkloads:
    14      - '*'
    15    podDisruptive: true
    16    schematic:
    17      cue:
    18        template: |
    19          patch: spec: template: spec: {
    20          	containers: [{
    21          		// +patchKey=name
    22          		volumeMounts: [
    23          			for v in parameter.volumes {
    24          				{
    25          					name:      "volume-\(v.name)"
    26          					mountPath: v.mountPath
    27          					readOnly:  v.readOnly
    28          				}
    29          			},
    30          		]
    31          	}, ...]
    32          	// +patchKey=name
    33          	volumes: [
    34          		for v in parameter.volumes {
    35          			{
    36          				name: "volume-\(v.name)"
    37          				configMap: name: v.name
    38          			}
    39          		},
    40          	]
    41          }
    42          outputs: {
    43          	for v in parameter.volumes {
    44          		if v.data != _|_ {
    45          			(v.name): {
    46          				apiVersion: "v1"
    47          				kind:       "ConfigMap"
    48          				metadata: name: v.name
    49          				data: v.data
    50          			}
    51          		}
    52          	}
    53          }
    54          parameter: {
    55          	// +usage=Specify mounted configmap names and their mount paths in the container
    56          	volumes: [...{
    57          		name:      string
    58          		mountPath: string
    59          		readOnly:  *false | bool
    60          		data?: [string]: string
    61          	}]
    62          }
    63