Skip to content

Commit

Permalink
Added CEL to list of valid ExpressionLangs
Browse files Browse the repository at this point in the history
Signed-off-by: Venera <[email protected]>
  • Loading branch information
venera-program committed Sep 13, 2023
1 parent 6d5de06 commit 279febd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion model/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (i ExpressionLangType) KindValues() []string {
return []string{
string(JqExpressionLang),
string(JsonPathExpressionLang),
string(CELExpressionLang),
}
}

Expand All @@ -88,6 +89,9 @@ const (

// JsonPathExpressionLang ...
JsonPathExpressionLang ExpressionLangType = "jsonpath"

// CELExpressionLang
CELExpressionLang ExpressionLangType = "cel"
)

// BaseWorkflow describes the partial Workflow definition that does not rely on generic interfaces
Expand Down Expand Up @@ -132,7 +136,7 @@ type BaseWorkflow struct {
// +optional
Constants *Constants `json:"constants,omitempty"`
// Identifies the expression language used for workflow expressions. Default is 'jq'.
// +kubebuilder:validation:Enum=jq;jsonpath
// +kubebuilder:validation:Enum=jq;jsonpath;cel
// +kubebuilder:default=jq
// +optional
ExpressionLang ExpressionLangType `json:"expressionLang,omitempty" validate:"required,oneofkind"`
Expand Down
2 changes: 1 addition & 1 deletion model/workflow_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ workflow.key required when "workflow.id" is not defined`,
model.BaseWorkflow.ExpressionLang = JqExpressionLang + "invalid"
return *model
},
Err: `workflow.expressionLang need by one of [jq jsonpath]`,
Err: `workflow.expressionLang need by one of [jq jsonpath cel]`,
},
}

Expand Down

0 comments on commit 279febd

Please sign in to comment.