mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
NK-31: Modified crd.yaml - added validation field that constraints policy resource creation.
This commit is contained in:
parent
647985ed80
commit
a9ebf2b7e3
2 changed files with 121 additions and 19 deletions
116
crd/crd.yaml
116
crd/crd.yaml
|
@ -16,12 +16,110 @@ spec:
|
|||
subresources:
|
||||
status: {}
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
properties:
|
||||
spec:
|
||||
properties:
|
||||
failurePolicy:
|
||||
type: string
|
||||
enum:
|
||||
- continueOnError
|
||||
- stopOnError
|
||||
openAPIV3Schema:
|
||||
properties:
|
||||
spec:
|
||||
required:
|
||||
- failurePolicy
|
||||
- rules
|
||||
properties:
|
||||
failurePolicy:
|
||||
type: string
|
||||
enum:
|
||||
- continueOnError
|
||||
- stopOnError
|
||||
rules:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- resource
|
||||
properties:
|
||||
resource:
|
||||
type: object
|
||||
required:
|
||||
- kind
|
||||
properties:
|
||||
kind:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
selector:
|
||||
properties:
|
||||
matchLabels:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
matchExpressions:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
patches:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- path
|
||||
- op
|
||||
- value
|
||||
properties:
|
||||
path:
|
||||
type: string
|
||||
op:
|
||||
type: string
|
||||
value:
|
||||
type: string
|
||||
configMapGenerator:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
copyFrom:
|
||||
type: object
|
||||
required:
|
||||
- namespace
|
||||
- name
|
||||
properties:
|
||||
namespace:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
data:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
secretGenerator:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
copyFrom:
|
||||
type: object
|
||||
required:
|
||||
- namespace
|
||||
- name
|
||||
properties:
|
||||
namespace:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
data:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
|
|
|
@ -5,13 +5,17 @@ metadata:
|
|||
spec:
|
||||
failurePolicy: continueOnError
|
||||
rules:
|
||||
- resource:
|
||||
kind: ConfigMap
|
||||
selector:
|
||||
matchLabels:
|
||||
label1: test1
|
||||
matchExpressions:
|
||||
patches:
|
||||
- path: /
|
||||
op : Add
|
||||
value : "20"
|
||||
- resource:
|
||||
kind: ConfigMap
|
||||
selector:
|
||||
matchLabels:
|
||||
label1: test1
|
||||
matchExpressions:
|
||||
- key: label2
|
||||
operator: In
|
||||
values:
|
||||
- test2
|
||||
patches:
|
||||
- path: /
|
||||
op : Add
|
||||
value : "20"
|
||||
|
|
Loading…
Reference in a new issue