Custom Event Metadata from Object
Author: matheuscscpCreated Jun 17, 2026Updated Aug 26, 2026
Labelsenhancementarea/notificationarea/api
xref: https://github.com/controlplaneio-fluxcd/flux-operator/pull/852#issuecomment-4638598592
This is an evolution of RFC-0008.
We could introduce two special annotations prefixed by the event.toolkit.fluxcd.io API group:
metadataTemplate: A Go template that must result in a JSON object that can be successfully parsed tomap[string]string. The template context is the Flux object through the symbolobj(like ResourceSetinputs).metadataExpression: A CEL expression similar to the above. Must result either in amap[string]string, or amap[string]anywhere all the underlying values arestring. The expression context is the Flux object through the symbolobj.
Example of CEL expression generating the map {tag0: value, digest0: value, tag1: value, digest1: value, ...} in a ResourceSetInputProvider:
apiVersion: fluxcd.controlplane.io/v1
kind: ResourceSetInputProvider
metadata:
name: podinfo
namespace: flux-system
annotations:
event.toolkit.fluxcd.io/deploymentID: e076e315-5a48-41c3-81c8-8d8bdee7d74d # RFC 0008
event.toolkit.fluxcd.io/metadataExpression: |
lists.range(obj.status.exportedInputs.size())
.map(n,
{
"tag" + string(n): obj.status.exportedInputs[n].tag,
"digest" + string(n): obj.status.exportedInputs[n].digest
}
).reduce(acc, m, acc.merge(m), {})
status:
exportedInputs:
- tag: ...
digest: ...
- tag: ...
digest: ...Source: fluxcd/flux2