Skip to main content

Annotations Plugin

The annotations plugin can insert annotations and labels into a given object. If any of the given annotations or labels are already present in the object, they will be overwritten.

The config can be templated with standard Go templating and has

.capsule

as its templating context.

Example

Config:

Helm values - Operator
config:
pipeline:
steps:
- plugins:
- plugin: rigdev.annotations
config: |
annotations:
key1: value1
labels:
key2: value2
group: apps
kind: Deployment

If the name of the capsule in the request context is my-capsule with corresponding Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-capsule
annotations:
key1: some-other-value
labels:
label: value
....

The resulting config of the Deployment is

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-capsule
annotations:
key1: value1
labels:
label: value
key2: value2
....

Config

Configuration for the annotations plugin

FieldDescription
annotations object (keys:string, values:string)Annotations are the annotations to insert into the object
labels object (keys:string, values:string)Labels are the labels to insert into the object
group stringGroup to match, for which objects to apply the patch to.
kind stringKind to match, for which objects to apply the patch to.
name stringName of the object to match. Defaults to Capsule-name.