Skip to content

Commit

Permalink
feat: [preconditions, conditions] added backwards-compatible support …
Browse files Browse the repository at this point in the history
…for logical operators (#1604)

Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
  • Loading branch information
yashvardhan-kukreja committed Mar 2, 2021
1 parent 6f15432 commit 10c714d
Show file tree
Hide file tree
Showing 21 changed files with 450 additions and 526 deletions.
88 changes: 8 additions & 80 deletions charts/kyverno/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -385,26 +385,8 @@ spec:
maxLength: 63
type: string
preconditions:
description: Conditions enable variable-based conditional rule execution. This is useful for finer control of when an rule is applied. A condition can reference object data using JMESPath notation.
items:
description: Condition defines variable-based conditional criteria for rule execution.
properties:
key:
description: Key is the context entry (using JMESPath) for conditional rule evaluation.
x-kubernetes-preserve-unknown-fields: true
operator:
description: Operator is the operation to perform. Valid operators are Equals, NotEquals, In and NotIn.
enum:
- Equals
- NotEquals
- In
- NotIn
type: string
value:
description: Value is the conditional value, or set of values. The values can be fixed set or can be variables declared using using JMESPath.
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
description: AnyAllConditions enable variable-based conditional rule execution. This is useful for finer control of when an rule is applied. A condition can reference object data using JMESPath notation. This too can be made to happen in a logical-manner where in some situation all the conditions need to pass and in some other situation, atleast one condition is enough to pass. For the sake of backwards compatibility, it can be populated with []kyverno.Condition.
x-kubernetes-preserve-unknown-fields: true
validate:
description: Validation is used to validate matching resources.
properties:
Expand All @@ -415,26 +397,8 @@ spec:
description: Deny defines conditions to fail the validation rule.
properties:
conditions:
description: Specifies set of condition to deny.
items:
description: Condition defines variable-based conditional criteria for rule execution.
properties:
key:
description: Key is the context entry (using JMESPath) for conditional rule evaluation.
x-kubernetes-preserve-unknown-fields: true
operator:
description: Operator is the operation to perform. Valid operators are Equals, NotEquals, In and NotIn.
enum:
- Equals
- NotEquals
- In
- NotIn
type: string
value:
description: Value is the conditional value, or set of values. The values can be fixed set or can be variables declared using using JMESPath.
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
description: specifies the set of conditions to deny in a logical manner For the sake of backwards compatibility, it can be populated with []kyverno.Condition.
x-kubernetes-preserve-unknown-fields: true
type: object
message:
description: Message specifies a custom message to be displayed on failure.
Expand Down Expand Up @@ -1565,26 +1529,8 @@ spec:
maxLength: 63
type: string
preconditions:
description: Conditions enable variable-based conditional rule execution. This is useful for finer control of when an rule is applied. A condition can reference object data using JMESPath notation.
items:
description: Condition defines variable-based conditional criteria for rule execution.
properties:
key:
description: Key is the context entry (using JMESPath) for conditional rule evaluation.
x-kubernetes-preserve-unknown-fields: true
operator:
description: Operator is the operation to perform. Valid operators are Equals, NotEquals, In and NotIn.
enum:
- Equals
- NotEquals
- In
- NotIn
type: string
value:
description: Value is the conditional value, or set of values. The values can be fixed set or can be variables declared using using JMESPath.
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
description: AnyAllConditions enable variable-based conditional rule execution. This is useful for finer control of when an rule is applied. A condition can reference object data using JMESPath notation. This too can be made to happen in a logical-manner where in some situation all the conditions need to pass and in some other situation, atleast one condition is enough to pass. For the sake of backwards compatibility, it can be populated with []kyverno.Condition.
x-kubernetes-preserve-unknown-fields: true
validate:
description: Validation is used to validate matching resources.
properties:
Expand All @@ -1595,26 +1541,8 @@ spec:
description: Deny defines conditions to fail the validation rule.
properties:
conditions:
description: Specifies set of condition to deny.
items:
description: Condition defines variable-based conditional criteria for rule execution.
properties:
key:
description: Key is the context entry (using JMESPath) for conditional rule evaluation.
x-kubernetes-preserve-unknown-fields: true
operator:
description: Operator is the operation to perform. Valid operators are Equals, NotEquals, In and NotIn.
enum:
- Equals
- NotEquals
- In
- NotIn
type: string
value:
description: Value is the conditional value, or set of values. The values can be fixed set or can be variables declared using using JMESPath.
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
description: specifies the set of conditions to deny in a logical manner For the sake of backwards compatibility, it can be populated with []kyverno.Condition.
x-kubernetes-preserve-unknown-fields: true
type: object
message:
description: Message specifies a custom message to be displayed on failure.
Expand Down
67 changes: 13 additions & 54 deletions definitions/crds/kyverno.io_clusterpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -583,34 +583,15 @@ spec:
maxLength: 63
type: string
preconditions:
description: Conditions enable variable-based conditional rule
execution. This is useful for finer control of when an rule
is applied. A condition can reference object data using JMESPath
notation.
items:
description: Condition defines variable-based conditional
criteria for rule execution.
properties:
key:
description: Key is the context entry (using JMESPath)
for conditional rule evaluation.
x-kubernetes-preserve-unknown-fields: true
operator:
description: Operator is the operation to perform. Valid
operators are Equals, NotEquals, In and NotIn.
enum:
- Equals
- NotEquals
- In
- NotIn
type: string
value:
description: Value is the conditional value, or set of
values. The values can be fixed set or can be variables
declared using using JMESPath.
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
description: AnyAllConditions enable variable-based conditional
rule execution. This is useful for finer control of when an
rule is applied. A condition can reference object data using
JMESPath notation. This too can be made to happen in a logical-manner
where in some situation all the conditions need to pass and
in some other situation, atleast one condition is enough to
pass. For the sake of backwards compatibility, it can be populated
with []kyverno.Condition.
x-kubernetes-preserve-unknown-fields: true
validate:
description: Validation is used to validate matching resources.
properties:
Expand All @@ -624,32 +605,10 @@ spec:
rule.
properties:
conditions:
description: Specifies set of condition to deny.
items:
description: Condition defines variable-based conditional
criteria for rule execution.
properties:
key:
description: Key is the context entry (using JMESPath)
for conditional rule evaluation.
x-kubernetes-preserve-unknown-fields: true
operator:
description: Operator is the operation to perform.
Valid operators are Equals, NotEquals, In and
NotIn.
enum:
- Equals
- NotEquals
- In
- NotIn
type: string
value:
description: Value is the conditional value, or
set of values. The values can be fixed set or
can be variables declared using using JMESPath.
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
description: specifies the set of conditions to deny
in a logical manner For the sake of backwards compatibility,
it can be populated with []kyverno.Condition.
x-kubernetes-preserve-unknown-fields: true
type: object
message:
description: Message specifies a custom message to be displayed
Expand Down
67 changes: 13 additions & 54 deletions definitions/crds/kyverno.io_policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -584,34 +584,15 @@ spec:
maxLength: 63
type: string
preconditions:
description: Conditions enable variable-based conditional rule
execution. This is useful for finer control of when an rule
is applied. A condition can reference object data using JMESPath
notation.
items:
description: Condition defines variable-based conditional
criteria for rule execution.
properties:
key:
description: Key is the context entry (using JMESPath)
for conditional rule evaluation.
x-kubernetes-preserve-unknown-fields: true
operator:
description: Operator is the operation to perform. Valid
operators are Equals, NotEquals, In and NotIn.
enum:
- Equals
- NotEquals
- In
- NotIn
type: string
value:
description: Value is the conditional value, or set of
values. The values can be fixed set or can be variables
declared using using JMESPath.
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
description: AnyAllConditions enable variable-based conditional
rule execution. This is useful for finer control of when an
rule is applied. A condition can reference object data using
JMESPath notation. This too can be made to happen in a logical-manner
where in some situation all the conditions need to pass and
in some other situation, atleast one condition is enough to
pass. For the sake of backwards compatibility, it can be populated
with []kyverno.Condition.
x-kubernetes-preserve-unknown-fields: true
validate:
description: Validation is used to validate matching resources.
properties:
Expand All @@ -625,32 +606,10 @@ spec:
rule.
properties:
conditions:
description: Specifies set of condition to deny.
items:
description: Condition defines variable-based conditional
criteria for rule execution.
properties:
key:
description: Key is the context entry (using JMESPath)
for conditional rule evaluation.
x-kubernetes-preserve-unknown-fields: true
operator:
description: Operator is the operation to perform.
Valid operators are Equals, NotEquals, In and
NotIn.
enum:
- Equals
- NotEquals
- In
- NotIn
type: string
value:
description: Value is the conditional value, or
set of values. The values can be fixed set or
can be variables declared using using JMESPath.
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
description: specifies the set of conditions to deny
in a logical manner For the sake of backwards compatibility,
it can be populated with []kyverno.Condition.
x-kubernetes-preserve-unknown-fields: true
type: object
message:
description: Message specifies a custom message to be displayed
Expand Down

0 comments on commit 10c714d

Please sign in to comment.