A Crossplane function that can be used in a function pipeline to gate further
progress within the pipeline based on supplied Event details.
apiVersion: ops.crossplane.io/v1alpha1
kind: WatchOperation
metadata:
name: analyze-events
spec:
watch:
apiVersion: v1
kind: Event
namespace: crossplane-system
concurrencyPolicy: Forbid
successfulHistoryLimit: 2
failedHistoryLimit: 1
operationTemplate:
spec:
mode: Pipeline
pipeline:
# Filter events to only pass those of type "Warning".
- step: filter-noisy-events
functionRef:
name: function-event-filter
input:
apiVersion: filter.event.fn.upbound.io/v1alpha1
kind: Input
type: WarningThis template uses Go, Docker, and the [Crossplane CLI][cli] to build functions.
# Run code generation - see input/generate.go
$ go generate ./...
# Run tests - see fn_test.go
$ go test ./...
# Build the function's runtime image - see Dockerfile
$ docker build . --tag=runtime
# Build a function package - see package/crossplane.yaml
$ crossplane xpkg build -f package --embed-runtime-image=runtime