# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/env.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  annotations:
    definition.oam.dev/description: add env on K8s pod for your workload which follows the pod spec in path 'spec.template.'
  name: env
  namespace: {{.Values.systemDefinitionNamespace}}
spec:
  appliesToWorkloads:
    - '*'
  schematic:
    cue:
      template: |
        patch: spec: template: spec: {
        	// +patchKey=name
        	containers: [{
        		name: context.name
        		// +patchStrategy=retainKeys
        		env: [
        			for k, v in parameter.env {
        				name:  k
        				value: v
        			},
        		]
        	}]
        }
        parameter: env: [string]: string

