Skip to content

Commit

Permalink
feat: add default compiler at the operation api level (#2047) (#2048)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
Co-authored-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
gcp-cherry-pick-bot[bot] and eddycharly authored Sep 30, 2024
1 parent dbbeda8 commit 5229eac
Show file tree
Hide file tree
Showing 19 changed files with 448 additions and 16 deletions.
14 changes: 14 additions & 0 deletions .crds/chainsaw.kyverno.io_configurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to use when
evaluating expressions.
enum:
- jp
- cel
type: string
delete:
description: Delete represents a deletion operation.
not:
Expand Down Expand Up @@ -1210,6 +1217,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to use
when evaluating expressions.
enum:
- jp
- cel
type: string
delete:
description: Delete represents a deletion operation.
not:
Expand Down
28 changes: 28 additions & 0 deletions .crds/chainsaw.kyverno.io_steptemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to use when
evaluating expressions.
enum:
- jp
- cel
type: string
delete:
description: Delete represents a deletion operation.
not:
Expand Down Expand Up @@ -979,6 +986,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to use when
evaluating expressions.
enum:
- jp
- cel
type: string
delete:
description: Delete represents a deletion operation.
not:
Expand Down Expand Up @@ -1738,6 +1752,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to use when
evaluating expressions.
enum:
- jp
- cel
type: string
delete:
description: Delete represents a deletion operation.
not:
Expand Down Expand Up @@ -2708,6 +2729,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to use when
evaluating expressions.
enum:
- jp
- cel
type: string
continueOnError:
description: |-
ContinueOnError determines whether a test should continue or not in case the operation was not successful.
Expand Down
35 changes: 35 additions & 0 deletions .crds/chainsaw.kyverno.io_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to use when
evaluating expressions.
enum:
- jp
- cel
type: string
delete:
description: Delete represents a deletion operation.
not:
Expand Down Expand Up @@ -1137,6 +1144,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to
use when evaluating expressions.
enum:
- jp
- cel
type: string
delete:
description: Delete represents a deletion operation.
not:
Expand Down Expand Up @@ -1916,6 +1930,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to
use when evaluating expressions.
enum:
- jp
- cel
type: string
delete:
description: Delete represents a deletion operation.
not:
Expand Down Expand Up @@ -2737,6 +2758,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to
use when evaluating expressions.
enum:
- jp
- cel
type: string
delete:
description: Delete represents a deletion operation.
not:
Expand Down Expand Up @@ -3767,6 +3795,13 @@ spec:
required:
- entrypoint
type: object
compiler:
description: Compiler defines the default compiler to
use when evaluating expressions.
enum:
- jp
- cel
type: string
continueOnError:
description: |-
ContinueOnError determines whether a test should continue or not in case the operation was not successful.
Expand Down
11 changes: 11 additions & 0 deletions .schemas/json/configuration-chainsaw-v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"delete": {
"description": "Delete represents a deletion operation.",
"type": [
Expand Down
11 changes: 11 additions & 0 deletions .schemas/json/configuration-chainsaw-v1alpha2.json
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"delete": {
"description": "Delete represents a deletion operation.",
"type": [
Expand Down
44 changes: 44 additions & 0 deletions .schemas/json/steptemplate-chainsaw-v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"delete": {
"description": "Delete represents a deletion operation.",
"type": [
Expand Down Expand Up @@ -1925,6 +1936,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"delete": {
"description": "Delete represents a deletion operation.",
"type": [
Expand Down Expand Up @@ -3199,6 +3221,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"delete": {
"description": "Delete represents a deletion operation.",
"type": [
Expand Down Expand Up @@ -5135,6 +5168,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"continueOnError": {
"description": "ContinueOnError determines whether a test should continue or not in case the operation was not successful.\nEven if the test continues executing, it will still be reported as failed.",
"type": [
Expand Down
55 changes: 55 additions & 0 deletions .schemas/json/test-chainsaw-v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"delete": {
"description": "Delete represents a deletion operation.",
"type": [
Expand Down Expand Up @@ -2193,6 +2204,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"delete": {
"description": "Delete represents a deletion operation.",
"type": [
Expand Down Expand Up @@ -3467,6 +3489,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"delete": {
"description": "Delete represents a deletion operation.",
"type": [
Expand Down Expand Up @@ -4809,6 +4842,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"delete": {
"description": "Delete represents a deletion operation.",
"type": [
Expand Down Expand Up @@ -6821,6 +6865,17 @@
},
"additionalProperties": false
},
"compiler": {
"description": "Compiler defines the default compiler to use when evaluating expressions.",
"type": [
"string",
"null"
],
"enum": [
"jp",
"cel"
]
},
"continueOnError": {
"description": "ContinueOnError determines whether a test should continue or not in case the operation was not successful.\nEven if the test continues executing, it will still be reported as failed.",
"type": [
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/v1alpha1/catch_finally.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ type CatchFinally struct {
// +optional
Description string `json:"description,omitempty"`

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

// PodLogs determines the pod logs collector to execute.
// +optional
PodLogs *PodLogs `json:"podLogs,omitempty"`
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/v1alpha1/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ type OperationBase struct {
// Even if the test continues executing, it will still be reported as failed.
// +optional
ContinueOnError *bool `json:"continueOnError,omitempty"`

// Compiler defines the default compiler to use when evaluating expressions.
// +optional
Compiler *Compiler `json:"compiler,omitempty"`
}

// Operation defines a single operation, only one action is permitted for a given operation.
Expand Down
10 changes: 10 additions & 0 deletions pkg/apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5229eac

Please sign in to comment.