Skip to content

Commit

Permalink
fix: engine api (kyverno#486)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly authored Sep 18, 2024
1 parent 87fe031 commit 137c2d1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/apis/policy/v1alpha1/assertion.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type Assertion struct {
Message string `json:"message,omitempty"`

// Engine defines the default engine to use when evaluating expressions.
// +optional
Engine *Engine `json:"engine,omitempty"`

// Check is the assertion check definition.
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/policy/v1alpha1/engine.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package v1alpha1

// Engine defines the engine to use when evaluating expressions.
// +kubebuilder:validation:Enum:=jp;cel
type Engine string

Expand Down
1 change: 1 addition & 0 deletions pkg/apis/policy/v1alpha1/validating_policy_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v1alpha1
// ValidatingPolicySpec contains the policy spec.
type ValidatingPolicySpec struct {
// Engine defines the default engine to use when evaluating expressions.
// +optional
Engine *Engine `json:"engine,omitempty"`

// Rules is a list of ValidatingRule instances.
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/policy/v1alpha1/validating_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type ValidatingRule struct {
Name string `json:"name"`

// Engine defines the default engine to use when evaluating expressions.
// +optional
Engine *Engine `json:"engine,omitempty"`

// Context defines variables and data sources that can be used during rule execution.
Expand Down
9 changes: 6 additions & 3 deletions website/docs/apis/kyverno-json.v1alpha1.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ auto_generated: true
| Field | Type | Required | Inline | Description |
|---|---|---|---|---|
| `message` | `string` | | | <p>Message is the message associated message.</p> |
| `engine` | [`Engine`](#json-kyverno-io-v1alpha1-Engine) | :white_check_mark: | | <p>Engine defines the default engine to use when evaluating expressions.</p> |
| `engine` | [`Engine`](#json-kyverno-io-v1alpha1-Engine) | | | <p>Engine defines the default engine to use when evaluating expressions.</p> |
| `check` | [`AssertionTree`](#json-kyverno-io-v1alpha1-AssertionTree) | :white_check_mark: | | <p>Check is the assertion check definition.</p> |

## `AssertionTree` {#json-kyverno-io-v1alpha1-AssertionTree}
Expand Down Expand Up @@ -119,6 +119,9 @@ auto_generated: true
- [ValidatingPolicySpec](#json-kyverno-io-v1alpha1-ValidatingPolicySpec)
- [ValidatingRule](#json-kyverno-io-v1alpha1-ValidatingRule)

<p>Engine defines the engine to use when evaluating expressions.</p>


## `Feedback` {#json-kyverno-io-v1alpha1-Feedback}

**Appears in:**
Expand Down Expand Up @@ -158,7 +161,7 @@ auto_generated: true

| Field | Type | Required | Inline | Description |
|---|---|---|---|---|
| `engine` | [`Engine`](#json-kyverno-io-v1alpha1-Engine) | :white_check_mark: | | <p>Engine defines the default engine to use when evaluating expressions.</p> |
| `engine` | [`Engine`](#json-kyverno-io-v1alpha1-Engine) | | | <p>Engine defines the default engine to use when evaluating expressions.</p> |
| `rules` | [`[]ValidatingRule`](#json-kyverno-io-v1alpha1-ValidatingRule) | :white_check_mark: | | <p>Rules is a list of ValidatingRule instances.</p> |

## `ValidatingRule` {#json-kyverno-io-v1alpha1-ValidatingRule}
Expand All @@ -173,7 +176,7 @@ auto_generated: true
| Field | Type | Required | Inline | Description |
|---|---|---|---|---|
| `name` | `string` | :white_check_mark: | | <p>Name is a label to identify the rule, It must be unique within the policy.</p> |
| `engine` | [`Engine`](#json-kyverno-io-v1alpha1-Engine) | :white_check_mark: | | <p>Engine defines the default engine to use when evaluating expressions.</p> |
| `engine` | [`Engine`](#json-kyverno-io-v1alpha1-Engine) | | | <p>Engine defines the default engine to use when evaluating expressions.</p> |
| `context` | [`[]ContextEntry`](#json-kyverno-io-v1alpha1-ContextEntry) | | | <p>Context defines variables and data sources that can be used during rule execution.</p> |
| `match` | [`Match`](#json-kyverno-io-v1alpha1-Match) | | | <p>Match defines when this policy rule should be applied.</p> |
| `exclude` | [`Match`](#json-kyverno-io-v1alpha1-Match) | | | <p>Exclude defines when this policy rule should not be applied.</p> |
Expand Down

0 comments on commit 137c2d1

Please sign in to comment.