github.com/oam-dev/kubevela@v1.9.11/charts/vela-core/templates/defwithtemplate/labels.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/internal/labels.cue
     3  apiVersion: core.oam.dev/v1beta1
     4  kind: TraitDefinition
     5  metadata:
     6    annotations:
     7      definition.oam.dev/description: Add labels on your workload. if it generates pod, add same label for generated pods.
     8    name: labels
     9    namespace: {{ include "systemDefinitionNamespace" . }}
    10  spec:
    11    appliesToWorkloads:
    12      - '*'
    13    podDisruptive: true
    14    schematic:
    15      cue:
    16        template: |
    17          // +patchStrategy=jsonMergePatch
    18          patch: {
    19          	metadata: labels: {
    20          		for k, v in parameter {
    21          			(k): v
    22          		}
    23          	}
    24          	if context.output.spec != _|_ && context.output.spec.template != _|_ {
    25          		spec: template: metadata: labels: {
    26          			for k, v in parameter {
    27          				(k): v
    28          			}
    29          		}
    30          	}
    31          }
    32          parameter: [string]: string | null
    33