Merge commit 'fe564d72279f4ab061b961dd528623f0ed272667' as 'cluster-config'
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: application-field-validation
|
||||
annotations:
|
||||
policies.kyverno.io/title: Application Field Validation
|
||||
policies.kyverno.io/category: Argo
|
||||
policies.kyverno.io/severity: medium
|
||||
policies.kyverno.io/subject: Application
|
||||
kyverno.io/kyverno-version: 1.6.0
|
||||
policies.kyverno.io/minversion: 1.6.0
|
||||
kyverno.io/kubernetes-version: "1.23"
|
||||
policies.kyverno.io/description: >-
|
||||
This policy performs some best practices validation on Application fields.
|
||||
Path or chart must be specified but never both. And destination.name or
|
||||
destination.server must be specified but never both.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
failurePolicy: Ignore
|
||||
background: false
|
||||
rules:
|
||||
- name: source-path-chart
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Application
|
||||
validate:
|
||||
message: >-
|
||||
`spec.source.path` OR `spec.source.chart` should be specified but never both.
|
||||
anyPattern:
|
||||
- spec:
|
||||
source:
|
||||
path: '?*'
|
||||
X(chart):
|
||||
- spec:
|
||||
source:
|
||||
X(path):
|
||||
chart: '?*'
|
||||
- name: destination-server-name
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Application
|
||||
validate:
|
||||
message: >-
|
||||
`spec.destination.server` OR `spec.destination.name` should be specified but never both.
|
||||
anyPattern:
|
||||
- spec:
|
||||
destination:
|
||||
server: '?*'
|
||||
X(name):
|
||||
- spec:
|
||||
destination:
|
||||
X(server):
|
||||
name: '?*'
|
||||
Reference in New Issue
Block a user