# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/labels.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  annotations:
    definition.oam.dev/description: Add labels on your workload. if it generates pod, add same label for generated pods.
  name: labels
  namespace: {{ include "systemDefinitionNamespace" . }}
spec:
  appliesToWorkloads:
    - '*'
  podDisruptive: true
  schematic:
    cue:
      template: |
        // +patchStrategy=jsonMergePatch
        patch: {
        	metadata: labels: {
        		for k, v in parameter {
        			(k): v
        		}
        	}
        	if context.output.spec != _|_ && context.output.spec.template != _|_ {
        		spec: template: metadata: labels: {
        			for k, v in parameter {
        				(k): v
        			}
        		}
        	}
        }
        parameter: [string]: string | null

