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