Skip to main content
Version: v1.4.x

Annotations

TypeTrait

Parameters​

No parameters available

Template​

The following tabs display the definition's Cue template and the rendered YAML. The rendered YAML is the output of the Cue template when the definition is applied to a cluster.

annotations: {
type: "trait"
annotations: {}
labels: {
"definition.spectrocloud.com/category": "Metadata"
}
description: "Add annotations on your workload. If it generates pod or job, add same annotations for generated pods."
attributes: {
version: "1.0.1"
}
}
template: {
// +patchStrategy=jsonMergePatch
patch: {
let annotationsContent = {
for k, v in parameter {
(k): v
}
}

metadata: {
annotations: annotationsContent
}
if context.output.spec != _|_ if context.output.spec.template != _|_ {
spec: template: metadata: annotations: annotationsContent
}
if context.output.spec != _|_ if context.output.spec.jobTemplate != _|_ {
spec: jobTemplate: metadata: annotations: annotationsContent
}
if context.output.spec != _|_ if context.output.spec.jobTemplate != _|_ if context.output.spec.jobTemplate.spec != _|_ if context.output.spec.jobTemplate.spec.template != _|_ {
spec: jobTemplate: spec: template: metadata: annotations: annotationsContent
}
}
parameter: [string]: string | null
}