mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
25 lines
623 B
YAML
25 lines
623 B
YAML
|
apiVersion: kyverno.io/v1
|
||
|
kind: ClusterPolicy
|
||
|
metadata:
|
||
|
name: allowed-annotations
|
||
|
spec:
|
||
|
background: true
|
||
|
rules:
|
||
|
- match:
|
||
|
any:
|
||
|
- resources:
|
||
|
kinds:
|
||
|
- Pod
|
||
|
name: allowed-fluxcd-annotations
|
||
|
validate:
|
||
|
deny:
|
||
|
conditions:
|
||
|
all:
|
||
|
- key: '{{ request.object.metadata.annotations.keys(@)[?contains(@, ''fluxcd.io/'')] }}'
|
||
|
operator: AnyNotIn
|
||
|
value:
|
||
|
- fluxcd.io/cow
|
||
|
- fluxcd.io/dog
|
||
|
message: The only approved FluxCD annotations are `fluxcd.io/cow` and `fluxcd.io/dog`.
|
||
|
validationFailureAction: Enforce
|